Commit 4d0d4308 authored by 4ast's avatar 4ast Committed by GitHub

Merge pull request #1012 from goldshtn/buildid-fix

cc: Fix SEGV when there is no build-id section
parents 88abfc68 e5d33dfd
......@@ -241,7 +241,7 @@ static int find_debuglink(Elf *e, char **debug_file, unsigned int *crc) {
static int find_buildid(Elf *e, char *buildid) {
Elf_Data *data = get_section_elf_data(e, ".note.gnu.build-id");
if (data->d_size <= 16 || strcmp((char *)data->d_buf + 12, "GNU"))
if (!data || data->d_size <= 16 || strcmp((char *)data->d_buf + 12, "GNU"))
return 0;
char *buf = (char *)data->d_buf + 16;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment