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

Commit 53e9fc79 authored by Mark Salyzyn's avatar Mark Salyzyn
Browse files

liblog: android_closeEventTagMap pointer check

Followup to c/278768 where failure to open tag map can
result in segment violation in android_closeEventTagMap.
Add check for pointer value = -1 to bypass call to close.

Test: gTest liblog-unit-tests, logcat-unit-tests & logd-unit-tests
Bug: 30963384
Bug: 31456426
Change-Id: I20547e55d7e29682fde4538bc1fc6d83b4535d49
parent bccb521c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -189,7 +189,7 @@ LIBLOG_ABI_PUBLIC void __android_log_close()
    __android_log_unlock();

#if defined(__BIONIC__)
    android_closeEventTagMap(m);
    if (m != (EventTagMap *)(uintptr_t)-1LL) android_closeEventTagMap(m);
#endif

}