summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2012-07-08 00:25:06 -0400
committerGreg Hudson <ghudson@mit.edu>2012-07-08 00:25:06 -0400
commitf74fa6199f328c837f452fe6a4ca9e5242484b3e (patch)
tree2f74d729caa5314d756991aae077450dac25974c /src
parentbc345d84e0b3c56a057a92ca76216d8af133b5f9 (diff)
downloadkrb5-f74fa6199f328c837f452fe6a4ca9e5242484b3e.tar.gz
krb5-f74fa6199f328c837f452fe6a4ca9e5242484b3e.tar.xz
krb5-f74fa6199f328c837f452fe6a4ca9e5242484b3e.zip
Reject extra realm separators in principal names
Commit f609e5caff410cc8f71db7d95b4da219541437db accidentally omitted the check for extra realm separators, leading to an assertion error when parsing x@y@z or similar. Restore the check.
Diffstat (limited to 'src')
-rw-r--r--src/lib/krb5/krb/parse.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/krb5/krb/parse.c b/src/lib/krb5/krb/parse.c
index cf3cce9d0d..613e41d1ff 100644
--- a/src/lib/krb5/krb/parse.c
+++ b/src/lib/krb5/krb/parse.c
@@ -79,6 +79,8 @@ allocate_princ(krb5_context context, const char *name, krb5_boolean enterprise,
} else if (*p == '@' && (!enterprise || !first_at)) {
/* Realm separator. In enterprise principals, the first one of
* these we see is part of the component. */
+ if (cur_data == &princ->realm)
+ return KRB5_PARSE_MALFORMED;
cur_data = &princ->realm;
} else {
/* Component or realm character, possibly quoted. Make note if