Closed s1gse9v closed 1 year ago
At least in my case the problem is solved by just doubling the size of buf
. Is the overhead of adding bounds-checking or heap-allocating a buffer worth it here?
i am not amazed, given that code is very old :/ thank you for the report.
can't repro, are you sure on the string?
Fairly sure, the sscanf
converts EEEEET
into 978670
, which should shift the trailing t
in int%i_t
just out of bounds of buf[10]
.
i can add some fixes, since that value should never be >64 etc..
When encountering the mangled symbol
I_EEEEET_PNS0_7IsolateENS0_7Runtime10FunctionIdEPKNS2_16TSCallDescriptorENS2_7OpIndexESU_RKT0_
,demangle_fund_type
insrc/gnu_v2/cplus-dem.c
overflows the stack-allocated bufferchar buf[10]
, initilialized incplus-dem.c:2744
. The offending logic is located in the switch case'I'
atcplus-dem.c:2859
, which reads the sequence of characters enclosed in_
after the initialI
as a hex value in2879
. The read value is then converted to a decimalint
and written back tobuf
, overflowing it. Since I don't fully understand demangling, I'm not sure how to create a minimal working example.