Fixed out of bound read in GB_load_state_from_buffer. Closes #104

This commit is contained in:
Lior Halphon 2019-06-21 03:04:38 +03:00
parent 72b1fe0500
commit 7c61445fe3

View File

@ -294,6 +294,8 @@ static bool buffer_read_section(const uint8_t **buffer, size_t *buffer_length, v
return false; return false;
} }
if (saved_size > *buffer_length) return false;
if (saved_size <= size) { if (saved_size <= size) {
if (buffer_read(dest, saved_size, buffer, buffer_length) != saved_size) { if (buffer_read(dest, saved_size, buffer, buffer_length) != saved_size) {
return false; return false;