mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-03-01 13:26:47 +08:00
Reading a simple file compiled with : $ gcc -DONE=1 -gdwarf-4 -g3 test.c $ gcc --version gcc (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0 I get: Reading symbols from /tmp/cwd/a.out... /home/smarchi/src/binutils-gdb/gdb/dwarf2/cooked-index.c:332:11: runtime error: null pointer passed as argument 2, which is declared to never be null It looks like even if the size is 0 (the size of the `entries` vector is 0), we shouldn't be passing a NULL pointer to memcpy. And `entries.data ()` returns NULL. Fix that by using std::vector::insert to insert the items of entries into m_entries. I haven't checked, but it should essentially compile down to a memcpy, since the vector elements are trivially copyiable. Change-Id: I75f1c901e9b522e42e89eb5936e2c70d68eb21e5 |
||
---|---|---|
.. | ||
abbrev-cache.c | ||
abbrev-cache.h | ||
abbrev.c | ||
abbrev.h | ||
attribute.c | ||
attribute.h | ||
comp-unit-head.c | ||
comp-unit-head.h | ||
cooked-index.c | ||
cooked-index.h | ||
cu.c | ||
cu.h | ||
die.h | ||
dwz.c | ||
dwz.h | ||
expr.c | ||
expr.h | ||
file-and-dir.h | ||
frame-tailcall.c | ||
frame-tailcall.h | ||
frame.c | ||
frame.h | ||
index-cache.c | ||
index-cache.h | ||
index-common.c | ||
index-common.h | ||
index-write.c | ||
index-write.h | ||
leb.c | ||
leb.h | ||
line-header.c | ||
line-header.h | ||
loc.c | ||
loc.h | ||
macro.c | ||
macro.h | ||
public.h | ||
read.c | ||
read.h | ||
sect-names.h | ||
section.c | ||
section.h | ||
stringify.c | ||
stringify.h |