zsh-workers
 help / color / mirror / code / Atom feed
From: Wayne Davison <wayned@users.sourceforge.net>
To: Zsh workers <zsh-workers@sunsite.dk>
Subject: Re: building latest sources
Date: Wed, 3 Mar 2004 10:52:26 -0800	[thread overview]
Message-ID: <20040303185226.GD9561@blorf.net> (raw)
In-Reply-To: <27115.1078251441@trentino.logica.co.uk>

[-- Attachment #1: Type: text/plain, Size: 387 bytes --]

On Tue, Mar 02, 2004 at 07:17:21PM +0100, Oliver Kiddle wrote:
> -	unmetafy(x, &cutbuf.len);
> +	unmetafy(x, (int *)&cutbuf.len);
[...]
> -	    unmetafy(*p, &kptr->len);
> +	    unmetafy(*p, (int *)&kptr->len);

You can't just cast away an error like that.  This code was (and is)
improperly assuming that an int can be put into a size_t memory
location.  Attached is my fix.

..wayne..

[-- Attachment #2: size.patch --]
[-- Type: text/plain, Size: 842 bytes --]

--- Src/Zle/zle_params.c	3 Mar 2004 11:05:46 -0000	1.13
+++ Src/Zle/zle_params.c	3 Mar 2004 18:30:10 -0000
@@ -365,7 +365,9 @@ set_cutbuffer(Param pm, char *x)
 	free(cutbuf.buf);
     cutbuf.flags = 0;
     if (x) {
-	unmetafy(x, (int *)&cutbuf.len);
+	int n;
+	unmetafy(x, &n);
+	cutbuf.len = n;
 	cutbuf.buf = zalloc(cutbuf.len);
 	memcpy((char *)cutbuf.buf, x, cutbuf.len);
 	free(x);
@@ -418,9 +420,10 @@ set_killring(Param pm, char **x)
 	kringsize = arrlen(x);
 	kring = (Cutbuffer)zshcalloc(kringsize * sizeof(struct cutbuffer));
 	for (p = x; *p; p++) {
-	    int len = strlen(*p);
+	    int n, len = strlen(*p);
 	    kptr = kring + kpos;
-	    unmetafy(*p, (int *)&kptr->len);
+	    unmetafy(*p, &n);
+	    kptr->len = n;
 	    kptr->buf = (char *)zalloc(kptr->len);
 	    memcpy(kptr->buf, *p, kptr->len);
 	    zfree(*p, len+1);

      parent reply	other threads:[~2004-03-03 18:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-02 18:17 Oliver Kiddle
2004-03-02 18:29 ` Peter Stephenson
2004-03-03 18:52 ` Wayne Davison [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040303185226.GD9561@blorf.net \
    --to=wayned@users.sourceforge.net \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).