From 970910c21ed82601d8e69c3963fb4d0b5133a339 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Wed, 23 Jul 2014 14:43:33 -0400 Subject: [PATCH] Runtime loader: Fix unchecked return value Tested by running Attraction! from haikuware.com CID 1228648 --- src/system/runtime_loader/runtime_loader.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/system/runtime_loader/runtime_loader.cpp b/src/system/runtime_loader/runtime_loader.cpp index 46c25dfc22..fa507eba7e 100644 --- a/src/system/runtime_loader/runtime_loader.cpp +++ b/src/system/runtime_loader/runtime_loader.cpp @@ -186,8 +186,9 @@ try_open_executable(const char *dir, int dirLength, const char *name, // However, only if it's a known library location for (int i = 0; i < 4; ++i) { char buffer[PATH_MAX]; - __find_directory(kLibraryDirectories[i], -1, false, buffer, PATH_MAX); - if (strncmp(dir, buffer, dirLength) == 0) { + status_t result = __find_directory(kLibraryDirectories[i], -1, + false, buffer, PATH_MAX); + if (result == B_OK && strncmp(dir, buffer, dirLength) == 0) { subDirLen = strlen(abiSpecificSubDir) + 1; break; }