CVE-2026-35414 脆弱性ブロック
static int
match_principals_option(const char *principal_list, struct sshkey_cert *cert)
{
char *result;
u_int i;
/* XXX percent_expand() sequences for authorized_principals? */
for (i = 0; i < cert->nprincipals; i++) {
if ((result = match_list(cert->principals[i],
principal_list, NULL)) != NULL) {
debug3("matched principal from key options \"%.100s\"",
result);
free(result);
return 1;
}
}
return 0;
}
static int
match_principals_option(const char *principal_list, struct sshkey_cert *cert)
{
char *list, *olist, *entry;
u_int i;
olist = list = xstrdup(principal_list);
for (;;) {
if ((entry = strsep(&list, ",")) == NULL || *entry == '\0')
break;
for (i = 0; i < cert->nprincipals; i++) {
if (strcmp(entry, cert->principals[i]) == 0) {
debug3("matched principal from key i"
"options \"%.100s\"", entry);
free(olist);
return 1;
}
}
}
free(olist);
return 0;
}