diff --git a/core/jni/android_os_UEventObserver.cpp b/core/jni/android_os_UEventObserver.cpp index 7033ff3c518f9..3f7c7d28f8b53 100644 --- a/core/jni/android_os_UEventObserver.cpp +++ b/core/jni/android_os_UEventObserver.cpp @@ -49,7 +49,7 @@ static bool isMatch(const char* buffer, size_t length) { // Consider all zero-delimited fields of the buffer. const char* field = buffer; - const char* end = buffer + length; + const char* end = buffer + length + 1; do { if (strstr(field, match.string())) { ALOGV("Matched uevent message with pattern: %s", match.string());