principal is malformed if it doesn't have at least 2 components
authorJohn Kohl <jtkohl@mit.edu>
Fri, 20 Apr 1990 15:01:54 +0000 (15:01 +0000)
committerJohn Kohl <jtkohl@mit.edu>
Fri, 20 Apr 1990 15:01:54 +0000 (15:01 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@541 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/krb/unparse.c

index 0ee112cb882d71f1142fab860b378096abb5aaf5..31a8f51f837ea9cf52e1e280d06a7c8b355a49ae 100644 (file)
@@ -52,6 +52,8 @@ register char **name;
     register int i;
     int totalsize = 0;
 
+    if (!principal[0] || !principal[1])
+       return KRB5_PARSE_MALFORMED;
     /* check for invalid elements of components; don't need to check
        realm, which is first component */
     for (i = 1; principal[i]; i++) {