include field separators in comparison
When comparing the first component of a multi-component string that uses a field separator (e.g., '/' or ':'), be sure to include the separator in the comparison to ensure that the comparison does not succeed due to a prefix match. Change-Id: Ieec3e73cb015a83bb652ec11cd7d83e57755c3d2
This commit is contained in:
@@ -176,7 +176,7 @@ main(int argc, char **argv)
|
||||
ret = krb5_unparse_name(context, ticket->server, &server);
|
||||
if (ret)
|
||||
krb5_err(context, 1, ret, "krb5_unparse_name");
|
||||
if (strncmp(server, "hprop/", 5) != 0)
|
||||
if (strncmp(server, "hprop/", 6) != 0)
|
||||
krb5_errx(context, 1, "ticket not for hprop (%s)", server);
|
||||
|
||||
free(server);
|
||||
|
Reference in New Issue
Block a user