This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][BZ #15374] Make getent services compliant with RFC 6335 section 5.1


On 10/20/2013 08:07 PM, OndÅej BÃlka wrote:
+      char *endptr;
+      long port = strtol (key[i], &endptr, 0);
+
+      if (*endptr == '\0')
+	serv = getservbyport (htons (port), proto);

This accepts leading "-" and "0x", which is not compliant with RFC 6335, either.

I'm not sure if the RFC is correct, a lot of software assumes that a leading digits in a service name indicates that it's a port number.

--
Florian Weimer / Red Hat Product Security Team


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]