(kadmin_startup): Properly skip "\@" and "\/" sequences when
authorKen Raeburn <raeburn@mit.edu>
Thu, 15 Jun 2006 22:01:57 +0000 (22:01 +0000)
committerKen Raeburn <raeburn@mit.edu>
Thu, 15 Jun 2006 22:01:57 +0000 (22:01 +0000)
processing principal name, rather than going into an infinite loop.
Suggested by Mark Phalan at Sun.

ticket: 3697

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18148 dc483132-0cff-0310-8789-dd5450dbe970

src/kadmin/cli/kadmin.c

index 0b134201560e08df473fde66bfc15c3516968980..e7594170dff8ef0dbdc9237d9b89cf4cff05351d 100644 (file)
@@ -404,7 +404,7 @@ char *kadmin_startup(argc, argv)
                if (realm - canon && *(realm - 1) != '\\')
                    break;
                else
-                   realm = strchr(realm, '@');
+                   realm = strchr(realm+1, '@');
            }
            if (realm)
                *realm++ = '\0';
@@ -413,7 +413,7 @@ char *kadmin_startup(argc, argv)
                if (cp - canon && *(cp - 1) != '\\')
                    break;
                else
-                   cp = strchr(cp, '/');
+                   cp = strchr(cp+1, '/');
            }
            if (cp != NULL)
                *cp = '\0';