Skip to content

Commit

Permalink
Fix potential DOS in decompilers (CVS-2017-8782)
Browse files Browse the repository at this point in the history
Closes #70
  • Loading branch information
strk committed Jun 2, 2017
1 parent e661d0f commit 6eca133
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions NEWS
@@ -1,5 +1,7 @@
0.4.9-dev - YYYY-MM-DD

* Fix potential DOS in decompilers (CVS-2017-8782, issue #70)

0.4.8 - 2017-04-07

* Add PHP7 compatibility
Expand Down
10 changes: 10 additions & 0 deletions util/read.c
Expand Up @@ -247,6 +247,11 @@ char *readString(FILE *f)
if(len >= buflen-2)
{
buf = (char *)realloc(buf, sizeof(char)*(buflen+256));
if ( ! buf )
{
fprintf(stderr, "failed reallocating %d bytes\n", buflen+256);
exit(-1);
}
buflen += 256;
p = buf+len;
}
Expand Down Expand Up @@ -350,6 +355,11 @@ char *readSizedString(FILE *f,int size)
if(len >= buflen-2)
{
buf = (char *)realloc(buf, sizeof(char)*(buflen+256));
if ( ! buf )
{
fprintf(stderr, "failed reallocating %d bytes\n", buflen+256);
exit(-1);
}
buflen += 256;
p = buf+len;
}
Expand Down

0 comments on commit 6eca133

Please sign in to comment.