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

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

krb5 commit: Fix gss_str_to_oid for OIDs with zero-valued arcs

daemon@ATHENA.MIT.EDU (Greg Hudson)
Tue Jan 1 18:02:28 2013

Date: Tue, 1 Jan 2013 18:02:22 -0500
From: Greg Hudson <ghudson@mit.edu>
Message-Id: <201301012302.r01N2Mtd013233@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/54fa4433df7412267375240aba40959e97ac4fe2
commit 54fa4433df7412267375240aba40959e97ac4fe2
Author: Luke Howard <lukeh@padl.com>
Date:   Sun Dec 30 10:36:25 2012 -0500

    Fix gss_str_to_oid for OIDs with zero-valued arcs
    
    gss_str_to_oid wasn't outputting any bytes for a zero-valued arc.  It
    should output one byte with value 0.
    
    [ghudson@mit.edu: commit message]
    
    ticket: 7523 (new)
    target_version: 1.11.1
    tags: pullup

 src/lib/gssapi/generic/oid_ops.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/lib/gssapi/generic/oid_ops.c b/src/lib/gssapi/generic/oid_ops.c
index 85584fc..de38dd7 100644
--- a/src/lib/gssapi/generic/oid_ops.c
+++ b/src/lib/gssapi/generic/oid_ops.c
@@ -345,10 +345,10 @@ generic_gss_str_to_oid(OM_uint32 *minor_status,
         if (sscanf((char *)bp, "%ld", &numbuf) != 1) {
             return(GSS_S_FAILURE);
         }
-        while (numbuf) {
+        do {
             nbytes++;
             numbuf >>= 7;
-        }
+        } while (numbuf);
         while ((bp < &cp[oid_str->length]) && isdigit(*bp))
             bp++;
         while ((bp < &cp[oid_str->length]) &&
@@ -386,20 +386,20 @@ generic_gss_str_to_oid(OM_uint32 *minor_status,
                 nbytes = 0;
                 /* Have to fill in the bytes msb-first */
                 onumbuf = numbuf;
-                while (numbuf) {
+                do {
                     nbytes++;
                     numbuf >>= 7;
-                }
+                } while (numbuf);
                 numbuf = onumbuf;
                 op += nbytes;
                 i = -1;
-                while (numbuf) {
+                do {
                     op[i] = (unsigned char) numbuf & 0x7f;
                     if (i != -1)
                         op[i] |= 0x80;
                     i--;
                     numbuf >>= 7;
-                }
+                } while (numbuf);
                 while (isdigit(*bp))
                     bp++;
                 while (isspace(*bp) || *bp == '.')
_______________________________________________
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