Fix incorrect size of array.
When using sscanf and "%4s", the array passed in must include space for
a nul terminator.
Bug: 26739265
Change-Id: I0140a6100ca370666ae61689087ba41b4914789d
diff --git a/libc/malloc_debug/Android.mk b/libc/malloc_debug/Android.mk
index fb36643..3576611 100644
--- a/libc/malloc_debug/Android.mk
+++ b/libc/malloc_debug/Android.mk
@@ -37,7 +37,6 @@
LOCAL_CFLAGS := \
-Wall \
-Werror \
- -fno-stack-protector \
-Wno-error=format-zero-length \
include $(BUILD_STATIC_LIBRARY)
diff --git a/libc/malloc_debug/MapData.cpp b/libc/malloc_debug/MapData.cpp
index 8e9c806..d57017e 100644
--- a/libc/malloc_debug/MapData.cpp
+++ b/libc/malloc_debug/MapData.cpp
@@ -44,7 +44,7 @@
uintptr_t start;
uintptr_t end;
uintptr_t offset;
- char permissions[4];
+ char permissions[5];
int name_pos;
if (sscanf(line, "%" PRIxPTR "-%" PRIxPTR " %4s %" PRIxPTR " %*x:%*x %*d %n", &start,
&end, permissions, &offset, &name_pos) < 2) {