tcpdump mailing list archives

Re: Question about an uninitialized array in bpf_filter


From: Denis Ovsienko <denis () ovsienko info>
Date: Tue, 7 Jan 2025 19:41:35 +0000

On Mon, 29 Apr 2024 16:19:04 +0200
Michal Ruprich <michalruprich () gmail com> wrote:

Hi,

I was wondering, whether the mem[BPF_MEMWORDS] array in function 
pcapint_filter_with_aux_data in bpf_filter.c should be initialized?
If the switch hits cases BPF_LD|BPF_MEM or BPF_LDX|BPF_MEM the
variables A or X are filled with random uninitialized data from the
array. Is it the case that this never happens before mem is filled
with relevant data? In all cases, setting it to mem[BPF_MEMWORDS] =
{0}; could not hurt probably?

Done, thank you.  Only the HP ANSI C compiler on HP-UX generated a
warning about it.

-- 
    Denis Ovsienko
_______________________________________________
tcpdump-workers mailing list -- tcpdump-workers () lists tcpdump org
To unsubscribe send an email to tcpdump-workers-leave () lists tcpdump org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s


Current thread: