Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions gzread.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,8 @@ int ZEXPORT gzungetc(int c, gzFile file) {

/* if output buffer empty, put byte at end (allows more pushing) */
if (state->x.have == 0) {
if (state->out == NULL || state->size == 0)
return -1;
state->x.have = 1;
state->x.next = state->out + (state->size << 1) - 1;
state->x.next[0] = (unsigned char)c;
Expand Down