]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Allocate one extra byte for zero termination
authorAndreas Öman <andreas@lonelycoder.com>
Fri, 2 May 2008 15:45:19 +0000 (15:45 +0000)
committerAndreas Öman <andreas@lonelycoder.com>
Fri, 2 May 2008 15:45:19 +0000 (15:45 +0000)
spawn.c

diff --git a/spawn.c b/spawn.c
index 43c8fbce1f195ff60953e78f056d478c7d7312fb..00fab2192e0e1d7a8d4919f33bc3cf2aa0010703 100644 (file)
--- a/spawn.c
+++ b/spawn.c
@@ -210,7 +210,7 @@ spawn_and_store_stdout(const char *prog, char *const argv[], char **outp)
     return 0;
   }
 
-  outbuf = malloc(totalsize);
+  outbuf = malloc(totalsize + 1);
   r = 0;
   while((b = TAILQ_FIRST(&bufs)) != NULL) {
     memcpy(outbuf + r, b->sob_buf, b->sob_size);