mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-01 19:58:15 +00:00
VerifyKey() returns true on the first non-zero byte instead of checking for a null terminator. This causes VerifyBuffer() to accept FlexBuffers with non-null-terminated keys. Subsequent access to those keys via strlen()/strcmp() reads out of bounds. The condition if (*p++) should be if (!*p++) — return true when a null terminator is found, not when any non-zero byte is found. Confirmed with AddressSanitizer: heap-buffer-overflow in strlen() after VerifyBuffer() returns true on a corrupted buffer.