Merge pull request #52 from jniewerth/patch-2

Fix "use-after-relocate" in stream_to_string
This commit is contained in:
Jeff Bezanson 2017-08-21 11:23:36 -04:00 committed by GitHub
commit 983c8476aa
1 changed files with 1 additions and 1 deletions

View File

@ -389,7 +389,7 @@ value_t stream_to_string(value_t *ps)
n = st->size;
str = cvalue_string(n);
memcpy(cvalue_data(str), value2c(ios_t*,*ps)->buf, n);
ios_trunc(st, 0);
ios_trunc(value2c(ios_t*,*ps), 0);
}
else {
char *b = ios_takebuf(st, &n); n--;