NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: lib/49429: Import strtonum(3)



On Dec 27,  3:10am, jnemeth%cue.bc.ca@localhost (John Nemeth) wrote:
-- Subject: Re: lib/49429: Import strtonum(3)

|  ...
|  	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.

That would make things worse for threaded programs, and it is only
a concern for eptr.

christos


Home | Main Index | Thread Index | Old Index