hx509: do not crash on missing FILE: name
This commit is contained in:
@@ -59,6 +59,12 @@ dir_init(hx509_context context,
|
||||
{
|
||||
*data = NULL;
|
||||
|
||||
if (residue == NULL || residue[0] == '\0') {
|
||||
hx509_set_error_string(context, 0, EINVAL,
|
||||
"DIR file name not specified");
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
{
|
||||
struct stat sb;
|
||||
int ret;
|
||||
|
@@ -384,6 +384,12 @@ file_init_common(hx509_context context,
|
||||
pem_ctx.flags = flags;
|
||||
pem_ctx.c = NULL;
|
||||
|
||||
if (residue == NULL || residue[0] == '\0') {
|
||||
hx509_set_error_string(context, 0, EINVAL,
|
||||
"PEM file name not specified");
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
*data = NULL;
|
||||
|
||||
if (lock == NULL)
|
||||
|
@@ -820,6 +820,11 @@ p11_init(hx509_context context,
|
||||
|
||||
*data = NULL;
|
||||
|
||||
if (residue == NULL || residue[0] == '\0') {
|
||||
hx509_set_error_string(context, 0, EINVAL,
|
||||
"PKCS#11 store not specified");
|
||||
return EINVAL;
|
||||
}
|
||||
list = strdup(residue);
|
||||
if (list == NULL)
|
||||
return ENOMEM;
|
||||
|
@@ -338,6 +338,12 @@ p12_init(hx509_context context,
|
||||
|
||||
*data = NULL;
|
||||
|
||||
if (residue == NULL || residue[0] == '\0') {
|
||||
hx509_set_error_string(context, 0, EINVAL,
|
||||
"PKCS#12 file not specified");
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
if (lock == NULL)
|
||||
lock = _hx509_empty_lock;
|
||||
|
||||
|
Reference in New Issue
Block a user