diff options
author | Luke Howard <lukeh@padl.com> | 2012-12-30 10:36:25 -0500 |
---|---|---|
committer | Tom Yu <tlyu@mit.edu> | 2013-02-22 18:23:59 -0500 |
commit | adf07b060c57ce900656d9ac6f491a84ede7bcc6 (patch) | |
tree | 9f33b0a6109a1225e1bcf7d71b5b68316ca4e950 | |
parent | 4fcd8cea7ee1594c25b9e7eec42ae3ce6775d93a (diff) | |
download | krb5-adf07b060c57ce900656d9ac6f491a84ede7bcc6.zip krb5-adf07b060c57ce900656d9ac6f491a84ede7bcc6.tar.gz krb5-adf07b060c57ce900656d9ac6f491a84ede7bcc6.tar.bz2 |
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]
(cherry picked from commit 54fa4433df7412267375240aba40959e97ac4fe2)
ticket: 7579 (new)
version_fixed: 1.10.4
status: resolved
-rw-r--r-- | 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 535fe57..7645efe 100644 --- a/src/lib/gssapi/generic/oid_ops.c +++ b/src/lib/gssapi/generic/oid_ops.c @@ -339,10 +339,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]) && @@ -380,20 +380,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 == '.') |