NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: lib/49429: Import strtonum(3)
The following reply was made to PR lib/49429; it has been noted by GNATS.
From: Joerg Sonnenberger <joerg%britannica.bec.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: lib-bug-people%netbsd.org@localhost, gnats-admin%netbsd.org@localhost,
netbsd-bugs%netbsd.org@localhost, n54%gmx.com@localhost
Subject: Re: lib/49429: Import strtonum(3)
Date: Sat, 27 Dec 2014 08:37:13 +0100
On Sat, Dec 27, 2014 at 03:10:01AM +0000, John Nemeth wrote:
> char *ep;
> int rep;
>
> if (*eptr == NULL)
> eptr = &ep;
>
> if (rerror == NULL)
> rerror = &rep;
> ...
>
> With this code, you have the possibility of returning pointers
> to the stack. You should declare ep and rep as static. Otherwise,
> strtoi() looks good.
Eh, no. The pointers are not returned at all.
Joerg
Home |
Main Index |
Thread Index |
Old Index