Commit f73b9e1e authored by Petri Hintukainen's avatar Petri Hintukainen

Check for NULL

parent 3f1bc248
......@@ -1196,6 +1196,10 @@ UDFDIR *udfread_opendir(udfread *udf, const char *path)
return NULL;
}
if (!dir) {
return NULL;
}
result = (UDFDIR *)calloc(1, sizeof(UDFDIR));
if (result) {
result->dir = dir;
......@@ -1208,7 +1212,7 @@ struct udfread_dirent *udfread_readdir(UDFDIR *p, struct udfread_dirent *entry)
{
const struct udf_file_identifier *fe;
if (!p || !entry) {
if (!p || !entry || !p->dir) {
return NULL;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment