Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 50adab94 authored by Peiyong Lin's avatar Peiyong Lin
Browse files

nullptr check on suffix.

The value of suffix could be nullptr, hence we should perform a nullptr
check.

Bug: b/309001559
Test: boot
Change-Id: Ifd0bf521544d378cb438a8d9c3e0ad2ed5a199db
parent aa21941f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -494,7 +494,7 @@ static void* load_system_driver(const char* kind, const char* suffix, const bool
    void* dso = nullptr;

    // Only use sphal namespace when system ANGLE binaries are not the default drivers.
    const bool useSphalNamespace = strcmp(suffix, ANGLE_SUFFIX_VALUE) != 0;
    const bool useSphalNamespace = suffix != nullptr && strcmp(suffix, ANGLE_SUFFIX_VALUE) != 0;

    const std::string absolutePath =
            findLibrary(libraryName, useSphalNamespace ? VENDOR_LIB_EGL_DIR : SYSTEM_LIB_PATH,