NetBSD-Bugs archive

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

Re: bin/32358



The following reply was made to PR bin/32358; it has been noted by GNATS.

From: Miwa Susumu <miwarin%gmail.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/32358
Date: Sat, 3 Jan 2015 23:50:05 +0900

 # uname -rsm
 NetBSD 6.1.5 i386
 
 <<< from here
 # diff -u inetd.c.orig inetd.c
 --- inetd.c.orig        2015-01-03 23:28:24.000000000 +0900
 +++ inetd.c     2015-01-03 23:29:30.000000000 +0900
 @@ -1424,7 +1424,7 @@
                 MALFORMED(arg); \
         val = (int)strtol((arg), &cp0, 10); \
         if (cp0 != NULL) { \
 -               if (cp0[1] != '\0') \
 +               if (cp0 == arg) \
                         MALFORMED((arg)); \
                 if (cp0[0] == 'k') \
                         val *= 1024; \
 >>> to here
 
 of course, It is an error if you set a large value.
 
   Jan  3 23:30:37 mogu inetd[3320]: setsockopt (SO_SNDBUF 262144): No
 buffer space available
 
 [note]
 from the manual.
 
 strtoq(3)
 
 > If endptr is non-nil, strtol() stores the address of the first invalid
 > character in *endptr.  If there were no digits at all, however, strtol()
 > stores the original value of nptr in *endptr.  (Thus, if *nptr is not
 > `\0' but **endptr is `\0' on return, the entire string was valid.)
 
 endptr not be NULL in any case.
 
 -- 
 miwarin
 


Home | Main Index | Thread Index | Old Index