Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Bug in zsh 4.0.7
- X-seq: zsh-workers 18904
- From: Chris Spiegel <matrix@xxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Bug in zsh 4.0.7
- Date: Fri, 25 Jul 2003 02:48:31 -0700
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
Hi,
There is a bug in Src/math.c of zsh 4.0.7, line 382. It is:
yyval.u.l = zstrtol(++ptr, &ptr, lastbase = 16);
The issue is that it's unspecified whether ++ptr or &ptr happens first.
Strictly speaking according to the C standard this results in undefined
behavior but in practice it means you may be taking the wrong address
(it may take the address of the pointer to 'X' or 'x', instead of the
address of the pointer one beyond 'X' or 'x').
The presumed fix would be:
ptr++;
yyval.u.l = zstrtol(ptr, &ptr, lastbase = 16);
References are C99 6.5p2 and C90 6.3p2.
Chris
Messages sorted by:
Reverse Date,
Date,
Thread,
Author