]> sigrok.org Git - libsigrok.git/commit
session: fixup access to uninitialized memory
authorGerhard Sittig <redacted>
Thu, 8 Feb 2018 21:11:58 +0000 (22:11 +0100)
committerUwe Hermann <redacted>
Fri, 9 Feb 2018 20:32:11 +0000 (21:32 +0100)
commitf129014ca4cc1e38749934c5089b8bcb2ab3ea35
tree9131e0f23aba5710edd50998da635ef81281ce3b
parentda6f107efffbc7b2744f1ca69e8dc3d0c71a0a4a
session: fixup access to uninitialized memory

The sr_packet_copy() routine could have written to an arbitrary memory
location. Make sure to allocate the space before writing to it, and
check for successful allocation before accessing the memory.

It's assumed that this error never took effect, as the routine appears
to be unused.

This was reported by clang's scan-build.
src/session.c