aboutsummaryrefslogtreecommitdiff
path: root/src/libmach
diff options
context:
space:
mode:
authorXi Wang <xi.wang@gmail.com>2013-01-30 17:46:12 -0800
committerRuss Cox <rsc@swtch.com>2013-01-30 17:46:12 -0800
commit0dc3aa4b1dcca64ca747de9ceb05f0033f884bd6 (patch)
tree721b6e257043b17395921ade381a13a62f6700f0 /src/libmach
parentdad9d0ac8faf5482c0305a1da7356b1b1982c0a0 (diff)
downloadplan9port-0dc3aa4b1dcca64ca747de9ceb05f0033f884bd6.tar.gz
plan9port-0dc3aa4b1dcca64ca747de9ceb05f0033f884bd6.tar.bz2
plan9port-0dc3aa4b1dcca64ca747de9ceb05f0033f884bd6.zip
libmach: fix crash in dwarfpc (misuse of realloc)
R=rsc CC=plan9port.codebot https://codereview.appspot.com/7225059
Diffstat (limited to 'src/libmach')
-rw-r--r--src/libmach/dwarfpc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libmach/dwarfpc.c b/src/libmach/dwarfpc.c
index 9c36cf08..31b6bb41 100644
--- a/src/libmach/dwarfpc.c
+++ b/src/libmach/dwarfpc.c
@@ -194,6 +194,7 @@ dwarfpctoline(Dwarf *d, ulong pc, char **cdir, char **dir, char **file, ulong *l
newf = realloc(f, (nf+1)*sizeof(f[0]));
if(newf == nil)
goto out;
+ f = newf;
f[nf++] = b.p;
s = dwarfgetstring(&b);
dwarfget128(&b);