From ca3dbb8d8bd7fa5cc08af00af538ca62158763a1 Mon Sep 17 00:00:00 2001
From: Paul Sokolovsky <pfalcon@users.sourceforge.net>
Date: Sat, 24 Jan 2015 00:22:47 +0200
Subject: [PATCH] stream: readall(): Make sure there's a trailing NUL char.

---
 py/stream.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/py/stream.c b/py/stream.c
index 921459a8d..b4ce1081b 100644
--- a/py/stream.c
+++ b/py/stream.c
@@ -289,6 +289,7 @@ STATIC mp_obj_t stream_readall(mp_obj_t self_in) {
     }
 
     vstr.len = total_size;
+    vstr.buf[total_size] = '\0';
     return mp_obj_new_str_from_vstr(STREAM_CONTENT_TYPE(o->type->stream_p), &vstr);
 }
 
-- 
GitLab