hx509: do not crash on missing FILE: name
This commit is contained in:
@@ -59,6 +59,12 @@ dir_init(hx509_context context,
|
|||||||
{
|
{
|
||||||
*data = NULL;
|
*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;
|
struct stat sb;
|
||||||
int ret;
|
int ret;
|
||||||
|
@@ -384,6 +384,12 @@ file_init_common(hx509_context context,
|
|||||||
pem_ctx.flags = flags;
|
pem_ctx.flags = flags;
|
||||||
pem_ctx.c = NULL;
|
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;
|
*data = NULL;
|
||||||
|
|
||||||
if (lock == NULL)
|
if (lock == NULL)
|
||||||
|
@@ -820,6 +820,11 @@ p11_init(hx509_context context,
|
|||||||
|
|
||||||
*data = NULL;
|
*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);
|
list = strdup(residue);
|
||||||
if (list == NULL)
|
if (list == NULL)
|
||||||
return ENOMEM;
|
return ENOMEM;
|
||||||
|
@@ -338,6 +338,12 @@ p12_init(hx509_context context,
|
|||||||
|
|
||||||
*data = NULL;
|
*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)
|
if (lock == NULL)
|
||||||
lock = _hx509_empty_lock;
|
lock = _hx509_empty_lock;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user