diff options
author | Harald Welte <laforge@osmocom.org> | 2022-06-27 08:06:25 +0200 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2022-06-27 08:07:48 +0200 |
commit | dcbc00d0c4fb3ddbcc4ef964f03da093e3b0af04 (patch) | |
tree | ca6ea6b317e2eee2e729a2a4b7839216c2aeb739 /src/Makefile.am | |
parent | 1885e0422ac999b32d680a91a31b70b9248f13bc (diff) |
osmo_pcap_lapd_write: Fix write of uninitialized byte(s)
The problem is that we don't zero-initialize the struct pcap_rechdr +
pcap_lapdhdr before memcpy'ing them to buf, before we call write:
==20097== Syscall param write(buf) points to uninitialised byte(s)
==20097== at 0x4E48471: write (write.c:26)
==20097== by 0x4DA8DE9: osmo_pcap_lapd_write (lapd_pcap.c:168)
==20097== by 0x4DA8433: send_ph_data_req (lapd.c:628)
==20097== by 0x4C94F5C: lapd_send_rej (lapd_core.c:536)
==20097== by 0x4C9A08A: lapd_rx_i (lapd_core.c:1574)
==20097== by 0x4C9AA8F: lapd_ph_data_ind (lapd_core.c:1708)
==20097== by 0x4DA7C55: lapd_receive (lapd.c:496)
==20097== by 0x4D96B2C: e1inp_rx_ts_lapd (e1_input.c:778)
==20097== by 0x4D9C97C: handle_ts_sign_read (e1d.c:78)
==20097== by 0x4D9D908: e1d_fd_cb (e1d.c:281)
==20097== by 0x4D1281B: poll_disp_fds (select.c:361)
==20097== by 0x4D12928: _osmo_select_main (select.c:399)
==20097== Address 0x1ffefffed7 is on thread 1's stack
==20097== in frame #1, created by osmo_pcap_lapd_write (lapd_pcap.c:129)
The whole idea of first filling the two structs on the stack, and then
copying them to another buffer on the stack is somehow weird. Let's
just create a combined struct on the stack and then fill that one
directly.
Change-Id: I358c71354cc6ddad1964cc4a988ad29b7ba617f1
Closes: OS#5592
Diffstat (limited to 'src/Makefile.am')
0 files changed, 0 insertions, 0 deletions