hx509: Don’t pass excess arguments to variadic functions

Found by Coverity (Samba CID 1544609).

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
This commit is contained in:
Joseph Sutton
2023-09-18 09:14:29 +12:00
committed by Nico Williams
parent d71035e2d1
commit 13f96a2c89

View File

@@ -1187,8 +1187,7 @@ hx509_ca_tbs_add_san_permanentIdentifier_string(hx509_context context,
p = strchr(freeme, ':');
if (!p) {
hx509_set_error_string(context, 0, EINVAL,
"Invalid PermanentIdentifier string (should be \"[<oid>]:[<id>]\")",
oidstr);
"Invalid PermanentIdentifier string (should be \"[<oid>]:[<id>]\")");
free(freeme);
return EINVAL;
}
@@ -1297,8 +1296,7 @@ hx509_ca_tbs_add_san_hardwareModuleName_string(hx509_context context,
if (!p) {
hx509_set_error_string(context, 0, EINVAL,
"Invalid HardwareModuleName string (should be "
"\"<oid>:<serial>\")",
oidstr);
"\"<oid>:<serial>\")");
free(freeme);
return EINVAL;
}