[3264] in Kerberos-V5-bugs

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

krb5-admin/1009: Infinite loop in src/kadmin/cli/kadmin.c:kadmin_parse_name()

daemon@ATHENA.MIT.EDU (Nicolas Williams)
Mon Nov 5 10:45:06 2001

Resent-From: gnats@rt-11.mit.edu (GNATS Management)
Resent-To: krb5-unassigned@rt-11.mit.edu
Resent-Reply-To: krb5-bugs@MIT.EDU, Nicolas.Williams@ubsw.com
Message-Id: <200111051542.KAA22169@sm0d1989cmp.stm.swissbank.com>
Date: Mon, 5 Nov 2001 10:42:32 -0500 (EST)
From: Nicolas Williams <Nicolas.Williams@ubsw.com>
Reply-To: Nicolas.Williams@ubsw.com
To: krb5-bugs@mit.edu


>Number:         1009
>Category:       krb5-admin
>Synopsis:       kadmin_parse_name() loops forever with, e.g., '@SOME.REALM'
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    krb5-unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   unknown
>Arrival-Date:   Mon Nov  5 10:45:00 EST 2001
>Last-Modified:
>Originator:     Nicolas Williams
>Organization:
UBS Warburg / Perot Systems Corp.
--
>Release:        krb5-1.2.2
>Environment:
Ultra-SPARC, Solaris 2.6
System: SunOS sm0d1989cmp 5.6 Generic_105181-12 sun4u sparc SUNW,Ultra-2
Architecture: sun4

>Description:
	Line 149 of src/kadmin/cli/kadmin.c should read:

	if (cp == fullname || *(cp - 1) != '\\')

	instead of:

	if (cp - fullname && *(cp - 1) != '\\')

	The expression (cp - fullname) is always true except when the
	name being parsed starts with '@' and therefore is useless.

	I believe the break condition was meant to be (cp == fullname || ...).

>How-To-Repeat:
	kadmin.local -q "ank -randkey @SWISSBANK.COM"
>Fix:
	Here's the unified patch:

Index: PER-122.19/kadmin/cli/kadmin.c
--- PER-122.19/kadmin/cli/kadmin.c Wed, 14 Mar 2001 14:20:32 -0500
+++ PER-122.19(w)/kadmin/cli/kadmin.c Mon, 05 Nov 2001 10:39:06 -0500
@@ -146,7 +146,7 @@
     strcpy(fullname, name);
     cp = strchr(fullname, '@');
     while (cp) {
-	if (cp - fullname && *(cp - 1) != '\\')
+	if (cp == fullname || *(cp - 1) != '\\')
 	    break;
 	else
 	    cp = strchr(cp, '@');

Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only 
for the individual named.  If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail.  Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free 
as information could be intercepted, corrupted, lost, destroyed, 
arrive late or incomplete, or contain viruses.  The sender therefore 
does not accept liability for any errors or omissions in the contents 
of this message which arise as a result of e-mail transmission.  If 
verification is required please request a hard-copy version.  This 
message is provided for informational purposes and should not be 
construed as a solicitation or offer to buy or sell any securities or 
related financial instruments.

>Audit-Trail:
>Unformatted:

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