Skip to content
Snippets Groups Projects
Commit 1fa55234 authored by Christopher Ferris's avatar Christopher Ferris
Browse files

Fix incorrect check of descsz value.

Bug: 25187394
Change-Id: I9642cf493b83ac0eecd71394718ecbefae5d9a33
parent 04766e5a
No related branches found
No related tags found
No related merge requests found
...@@ -63,10 +63,10 @@ static bool get_build_id( ...@@ -63,10 +63,10 @@ static bool get_build_id(
if (nhdr.n_type == NT_GNU_BUILD_ID) { if (nhdr.n_type == NT_GNU_BUILD_ID) {
// Skip the name (which is the owner and should be "GNU"). // Skip the name (which is the owner and should be "GNU").
addr += NOTE_ALIGN(nhdr.n_namesz); addr += NOTE_ALIGN(nhdr.n_namesz);
uint8_t build_id_data[128]; uint8_t build_id_data[160];
if (nhdr.n_namesz > sizeof(build_id_data)) { if (nhdr.n_descsz > sizeof(build_id_data)) {
ALOGE("Possible corrupted note, name size value is too large: %u", ALOGE("Possible corrupted note, desc size value is too large: %u",
nhdr.n_namesz); nhdr.n_descsz);
return false; return false;
} }
if (backtrace->Read(addr, build_id_data, nhdr.n_descsz) != nhdr.n_descsz) { if (backtrace->Read(addr, build_id_data, nhdr.n_descsz) != nhdr.n_descsz) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment