storage_support.cpp: add NULL check

check_path_name() had NULL check of path, but its result was not used.
So, add if statement to return B_BAD_VALUE when path is NULL.

Change-Id: I8ceec5d592267bf0f00f606eba44c0ecaef5a209
Reviewed-on: https://review.haiku-os.org/628
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Murai Takashi
2018-10-14 17:34:05 +00:00
committed by waddlesplash
parent bd4813fcc3
commit af567e32be
+3
View File
@@ -383,7 +383,10 @@ check_entry_name(const char *entry)
status_t
check_path_name(const char *path)
{
// check the path is not NULL
status_t error = (path ? B_OK : B_BAD_VALUE);
if (error == B_BAD_VALUE)
return error;
// check the path components
const char *remainder = path;
int32 length, nextComponent;