Closed yabinc closed 2 years ago
Not sure it is actually possible to build a system with trace hardware that could generate an input sequence with 7 ID changes in a single frame, but in the event the correct response is to not increment the index larger than 6 and skip the last initialisation.
Will look at this in more detail in due course.
There is a case if 7 ID changes occur in a frame, each with following data assigned to the previous ID, the final ID/Data byte being data, where 8 buffers are required.
Unlikely to be possible in real hardware but fix applied to ensure robustness of the library
Releases in version 1.3.3
It's reported by kj2648@gmail.com in Android. Forward it to upstream:
Issue Description
Out of bound found in libopencsd_decoder due to absense of bound check in TraceFmtDcdImpl::unpackFrame() in trc_frame_deformatter.cpp.
It may cause security vulnerability by reading and writing invalid memory address.
external/OpenCSD/decoder/source/trc_frame_deformatter_impl.h
m_out_data
is a member variable of class TraceFmtDcdImpl, which is a 7-length array type....
158 out_chan_data m_out_data[7];
suggest fix:
0001-Fix-Out-of-Bounds-in-TraceFmtDcdImpl-unpackFrame.patch