mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-09-05 21:14:36 +00:00
Fixed a bug that caused a stringop-overflow warning when compiling load.c.
This commit is contained in:
@@ -188,6 +188,9 @@ static int stream_get(stream_t *stream, json_error_t *error) {
|
||||
assert(count >= 2);
|
||||
assert(count <= 4);
|
||||
|
||||
if (count >= sizeof(stream->buffer))
|
||||
goto out;
|
||||
|
||||
// if count == 4 , i will become 5 and overflow.
|
||||
for (i = 1; i < count; i++)
|
||||
stream->buffer[i] = stream->get(stream->data);
|
||||
|
||||
Reference in New Issue
Block a user