Skip to content

Commit

Permalink
Fixed a segfault when doing an empty gzip.deflate
Browse files Browse the repository at this point in the history
  • Loading branch information
waveto committed Jan 14, 2010
1 parent d2a9c3b commit f27af24
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions compress.cc
Expand Up @@ -45,13 +45,13 @@ class Gzip : public EventEmitter {
char* temp;
int i=1;

if (data_len == 0)
return 0;

*out = NULL;
*out_len = 0;
ret = 0;

if (data_len == 0)
return 0;

while(data_len>0) {
if (data_len>CHUNK) {
strm.avail_in = CHUNK;
Expand Down Expand Up @@ -244,12 +244,11 @@ class Gunzip : public EventEmitter {
char* temp;
int i=1;

if (data_len == 0)
return 0;

*out = NULL;
*out_len = 0;

if (data_len == 0)
return 0;

while(data_len>0) {
if (data_len>CHUNK) {
Expand Down

0 comments on commit f27af24

Please sign in to comment.