[28295] in CVS-changelog-for-Kerberos-V5

home help back first fref pref prev next nref lref last post

krb5 commit: Make use of strtoul() unconditional in locate_kdc

daemon@ATHENA.MIT.EDU (Greg Hudson)
Thu Mar 20 17:57:18 2014

Date: Thu, 20 Mar 2014 17:57:13 -0400
From: Greg Hudson <ghudson@mit.edu>
Message-Id: <201403202157.s2KLvDtl023984@drugstore.mit.edu>
To: cvs-krb5@mit.edu
Reply-To: krbdev@mit.edu
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cvs-krb5-bounces@mit.edu

https://github.com/krb5/krb5/commit/d03aff9fa23a5ad223bb7e7a8c48c070d64e1aa3
commit d03aff9fa23a5ad223bb7e7a8c48c070d64e1aa3
Author: Nalin Dahyabhai <nalin@dahyabhai.net>
Date:   Fri Feb 7 20:14:24 2014 -0500

    Make use of strtoul() unconditional in locate_kdc
    
    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 |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/src/lib/krb5/os/locate_kdc.c b/src/lib/krb5/os/locate_kdc.c
index f0b8481..88d55a8 100644
--- a/src/lib/krb5/os/locate_kdc.c
+++ b/src/lib/krb5/os/locate_kdc.c
@@ -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;
_______________________________________________
cvs-krb5 mailing list
cvs-krb5@mit.edu
https://mailman.mit.edu/mailman/listinfo/cvs-krb5

home help back first fref pref prev next nref lref last post