From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25885 invoked from network); 3 Mar 2004 18:52:39 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 3 Mar 2004 18:52:39 -0000 Received: (qmail 17286 invoked by alias); 3 Mar 2004 18:52:28 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19530 Received: (qmail 17259 invoked from network); 3 Mar 2004 18:52:27 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 3 Mar 2004 18:52:27 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [63.249.88.2] by sunsite.dk (MessageWall 1.0.8) with SMTP; 3 Mar 2004 18:52:27 -0000 Received: by binome.blorf.net (Postfix, from userid 1000) id 23D512980; Wed, 3 Mar 2004 10:52:26 -0800 (PST) Date: Wed, 3 Mar 2004 10:52:26 -0800 From: Wayne Davison To: Zsh workers Subject: Re: building latest sources Message-ID: <20040303185226.GD9561@blorf.net> References: <27115.1078251441@trentino.logica.co.uk> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="1SQmhf2mF2YjsYvc" Content-Disposition: inline In-Reply-To: <27115.1078251441@trentino.logica.co.uk> User-Agent: Mutt/1.5.5.1+cvs20040105i --1SQmhf2mF2YjsYvc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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.. --1SQmhf2mF2YjsYvc Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="size.patch" --- 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); --1SQmhf2mF2YjsYvc--