]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Make use of strtoul() unconditional in locate_kdc
authorNalin Dahyabhai <nalin@dahyabhai.net>
Sat, 8 Feb 2014 01:14:24 +0000 (20:14 -0500)
committerGreg Hudson <ghudson@mit.edu>
Thu, 20 Mar 2014 21:51:30 +0000 (17:51 -0400)
When parsing port numbers, we previously attempted to conditionalize use
of strtoul() on whether or not it was available, falling back to atoi()
instead, but we did so in a way that would always fall back to using
atoi().  We also call strtoul() from elsewhere without that condition,
so we don't gain anything by trying to be careful about it here.

src/lib/krb5/os/locate_kdc.c

index f0b84818dbc3a720e48050c3f000623230046d54..88d55a875284d4e964114cff3b17c7b451df2801 100644 (file)
@@ -217,14 +217,10 @@ locate_srv_conf_1(krb5_context context, const krb5_data *realm,
 
         if (port) {
             unsigned long l;
-#ifdef HAVE_STROUL
             char *endptr;
             l = strtoul (port, &endptr, 10);
             if (endptr == NULL || *endptr != 0)
                 return EINVAL;
-#else
-            l = atoi (port);
-#endif
             /* L is unsigned, don't need to check <0.  */
             if (l > 65535)
                 return EINVAL;