readelf: segfault at readelf.c:12227
This is another one where not cleaning up sufficiently after processing one file can lead to errors when processing the next file. We have ngnuchains non-zero but gnuchains NULL in the following: off < ngnuchains && (gnuchains[off] & 1) == 0 * readelf.c (process_symbol_table): Clear ngnuchains, ngnubuckets and nbuckets.
This commit is contained in:
parent
8ff66993e0
commit
a5e0be5cb2
2 changed files with 11 additions and 0 deletions
|
@ -12188,6 +12188,7 @@ process_symbol_table (Filedata * filedata)
|
|||
|
||||
free (buckets);
|
||||
buckets = NULL;
|
||||
nbuckets = 0;
|
||||
free (chains);
|
||||
chains = NULL;
|
||||
|
||||
|
@ -12263,8 +12264,10 @@ process_symbol_table (Filedata * filedata)
|
|||
}
|
||||
free (gnubuckets);
|
||||
gnubuckets = NULL;
|
||||
ngnubuckets = 0;
|
||||
free (gnuchains);
|
||||
gnuchains = NULL;
|
||||
ngnuchains = 0;
|
||||
free (mipsxlat);
|
||||
mipsxlat = NULL;
|
||||
return TRUE;
|
||||
|
@ -12272,12 +12275,15 @@ process_symbol_table (Filedata * filedata)
|
|||
err_out:
|
||||
free (gnubuckets);
|
||||
gnubuckets = NULL;
|
||||
ngnubuckets = 0;
|
||||
free (gnuchains);
|
||||
gnuchains = NULL;
|
||||
ngnuchains = 0
|
||||
free (mipsxlat);
|
||||
mipsxlat = NULL;
|
||||
free (buckets);
|
||||
buckets = NULL;
|
||||
nbuckets = 0;
|
||||
free (chains);
|
||||
chains = NULL;
|
||||
return FALSE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue