From 4fd2531302717e8947e549c1fa55d7f73fb31901 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Fri, 17 Feb 2012 11:42:53 -0800 Subject: [PATCH] Fix to properly null-terminate export list --- env.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/env.cpp b/env.cpp index 8146cf339..75445475b 100644 --- a/env.cpp +++ b/env.cpp @@ -1667,7 +1667,7 @@ char **env_export_arr( int recalc ) export_func2(vals, &export_buffer ); export_arr = (char **)realloc( export_arr, - sizeof(char *)*(vals.size()) + 4) ; //REVIEW I replaced 1 with 4 because I was getting an invalid write of 4 bytes for export[arr] = 0 below + sizeof(char *)*(1 + vals.size())); //add 1 for null termination for( i=0; i