|
From: Jeremy F. <je...@go...> - 2005-02-25 05:33:59
|
CVS commit by fitzhardinge:
Allocate enough space for the terminal \0 when allocating space for the filename.
M +1 -1 vg_procselfmaps.c 1.19
--- valgrind/coregrind/vg_procselfmaps.c #1.18:1.19
@@ -241,5 +241,5 @@ void VG_(parse_procselfmaps) (
/* Minor hack: put a '\0' at the filename end for the call to
`record_mapping', then restore the old char with `tmp'. */
- filename = VG_(arena_malloc)(VG_AR_CORE, i_eol-i);
+ filename = VG_(arena_malloc)(VG_AR_CORE, i_eol-i+1);
VG_(memcpy)(filename, &procmap_buf[i], i_eol-i);
filename[i_eol - i] = '\0';
|