From af567e32be52e438e608b209cbe83260534629ae Mon Sep 17 00:00:00 2001 From: Murai Takashi Date: Sun, 14 Oct 2018 09:42:52 +0900 Subject: [PATCH] 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 --- src/kits/storage/storage_support.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/kits/storage/storage_support.cpp b/src/kits/storage/storage_support.cpp index bafa960e54..194b0b1c61 100644 --- a/src/kits/storage/storage_support.cpp +++ b/src/kits/storage/storage_support.cpp @@ -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;