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:
committed by
waddlesplash
parent
bd4813fcc3
commit
af567e32be
@@ -383,7 +383,10 @@ check_entry_name(const char *entry)
|
|||||||
status_t
|
status_t
|
||||||
check_path_name(const char *path)
|
check_path_name(const char *path)
|
||||||
{
|
{
|
||||||
|
// check the path is not NULL
|
||||||
status_t error = (path ? B_OK : B_BAD_VALUE);
|
status_t error = (path ? B_OK : B_BAD_VALUE);
|
||||||
|
if (error == B_BAD_VALUE)
|
||||||
|
return error;
|
||||||
// check the path components
|
// check the path components
|
||||||
const char *remainder = path;
|
const char *remainder = path;
|
||||||
int32 length, nextComponent;
|
int32 length, nextComponent;
|
||||||
|
|||||||
Reference in New Issue
Block a user