diff options
author | Tatsuya Kinoshita <tats@debian.org> | 2016-09-02 14:01:37 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-02 14:01:37 +0000 |
commit | d43527cfa0dbb3ccefec4a6f7b32c1434739aa29 (patch) | |
tree | 30c4f88ed973ba97d823751c2cdbd95827ac145f | |
parent | Update ChangeLog (diff) | |
parent | Fix potential heap buffer corruption due to Strgrow (diff) | |
download | w3m-d43527cfa0dbb3ccefec4a6f7b32c1434739aa29.tar.gz w3m-d43527cfa0dbb3ccefec4a6f7b32c1434739aa29.zip |
Merge pull request #27 from kcwu/fix-strgrow
Fix potential heap buffer corruption due to Strgrow
-rw-r--r-- | Str.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; |