From 749becfa689186a6ab5cc6d83f9f470cced9b05c Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Thu, 13 Jul 2023 21:19:50 +0000 Subject: [PATCH] Fix libutils_fuzz_string8 deadlock. Bug: 290835996 Test: libutils_fuzz_string8 for several minutes Change-Id: I9b312dd968c380f4fa2a837d38121d0a7a7ac7b1 --- libutils/String8_fuzz.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libutils/String8_fuzz.cpp b/libutils/String8_fuzz.cpp index faf49b66b..e5dcd316e 100644 --- a/libutils/String8_fuzz.cpp +++ b/libutils/String8_fuzz.cpp @@ -45,6 +45,8 @@ std::vectortoLower(); }, [](FuzzedDataProvider*, android::String8* str1, android::String8* str2) -> void { + if (str2->size() == 0) return; + str1->removeAll(str2->c_str()); }, [](FuzzedDataProvider*, android::String8* str1, android::String8* str2) -> void {