hx509: do not crash on missing FILE: name

This commit is contained in:
Nicolas Williams
2019-07-03 20:09:13 -05:00
parent cc8a5c59a8
commit 63116100a8
4 changed files with 23 additions and 0 deletions

View File

@@ -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;