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