Skip to content

Commit

Permalink
formats: Do not use memcpy with NULL source or destination in memread…
Browse files Browse the repository at this point in the history
…_buf()
  • Loading branch information
mrannanj committed Dec 1, 2024
1 parent eb66f0c commit bed5a7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/formats/internal/memreader.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void memreader_close(memreader *reader) {
}

int memread_buf(memreader *reader, char *buf, int len) {
if(reader->pos + len > reader->len) {
if(reader->pos + len > reader->len || buf == NULL || reader->buf == NULL) {
return 0;
}
memcpy(buf, reader->buf + reader->pos, len);
Expand Down

0 comments on commit bed5a7b

Please sign in to comment.