Skip to content
Permalink
Browse files

Merge pull request #27 from kcwu/fix-strgrow

Fix potential heap buffer corruption due to Strgrow
  • Loading branch information...
tats committed Sep 2, 2016
2 parents e79a099 + c95a43d commit d43527cfa0dbb3ccefec4a6f7b32c1434739aa29
Showing with 2 additions and 2 deletions.
  1. +2 −2 Str.c
4 Str.c
@@ -232,8 +232,8 @@ Strgrow(Str x)
{
char *old = x->ptr;
int newlen;
newlen = x->length * 6 / 5;
if (newlen == x->length)
newlen = x->area_size * 6 / 5;
if (newlen == x->area_size)
newlen += 2;
x->ptr = GC_MALLOC_ATOMIC(newlen);
x->area_size = newlen;

0 comments on commit d43527c

Please sign in to comment.
You can’t perform that action at this time.