shithub: femtolisp

Download patch

ref: 983c8476aaabb3ae2868371be198c9ee972dd0dc
parent: 643c3041254022f8d5af684c9e6deaf9cbeed759
parent: 547876db1cb424ef4cbc2890eabbe34157cfa079
author: Jeff Bezanson <jeff.bezanson@gmail.com>
date: Mon Aug 21 07:23:36 EDT 2017

Merge pull request #52 from jniewerth/patch-2

Fix "use-after-relocate" in stream_to_string

--- a/iostream.c
+++ b/iostream.c
@@ -389,7 +389,7 @@
         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--;