From fa8037c207181e7f2c0648ea5c8dfe46783a86e6 Mon Sep 17 00:00:00 2001 From: zijunzhao Date: Fri, 31 Mar 2023 23:50:37 +0000 Subject: [PATCH] Handle with the nonnull case in a tricky way The func readdir() is not allowed to pass a nullptr. Bug: b/245972273 Test: mm Change-Id: Idbb3f552b026dc6d727886d22989d3359ed6633b --- debuggerd/crasher/crasher.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debuggerd/crasher/crasher.cpp b/debuggerd/crasher/crasher.cpp index 4043a6e03..6a1987882 100644 --- a/debuggerd/crasher/crasher.cpp +++ b/debuggerd/crasher/crasher.cpp @@ -164,7 +164,8 @@ noinline void fprintf_null() { } noinline void readdir_null() { - readdir(nullptr); + DIR* sneaky_null = nullptr; + readdir(sneaky_null); } noinline int strlen_null() {