Skip to content

Improve libelf diagnostics, fix bugs and typos#27

Open
ammallya wants to merge 1 commit into
amd-stagingfrom
users/lmoriche/misc-bug-fixes
Open

Improve libelf diagnostics, fix bugs and typos#27
ammallya wants to merge 1 commit into
amd-stagingfrom
users/lmoriche/misc-bug-fixes

Conversation

@ammallya
Copy link
Copy Markdown
Contributor

Add elf_errmsg () to elf_begin (), elf_getphdrnum (), gelf_getphdr () failure messages so libelf error reasons are visible.

In process_dbgapi_events (), switch on one_bit instead of stop_reason to correctly handle single bit stop-reasons.

In log (), use vsnprintf with size+1 buffer and resize to avoid buffer overrun; replace vsprintf.

In code_object_t::open (), add a bounds check when %-decoding the URI to avoid an out-of-bounds memory access.

Check elf_strptr () for null before constructing a std::string.

Fix typos.

Change-Id: I71ea1641d21190d5c2d8525e9aaf3837cc35057b

Add elf_errmsg () to elf_begin (), elf_getphdrnum (), gelf_getphdr ()
failure messages so libelf error reasons are visible.

In process_dbgapi_events (), switch on one_bit instead of stop_reason
to correctly handle single bit stop-reasons.

In log (), use vsnprintf with size+1 buffer and resize to avoid
buffer overrun; replace vsprintf.

In code_object_t::open (), add a bounds check when %-decoding the URI
to avoid an out-of-bounds memory access.

Check elf_strptr () for null before constructing a std::string.

Fix typos.

Change-Id: I71ea1641d21190d5c2d8525e9aaf3837cc35057b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants