ka9q / ka9q-radio

Multichannel SDR based on fast convolution and IP multicasting
GNU General Public License v3.0
161 stars 36 forks source link

Fix uninitialized reads #2

Closed argilo closed 2 years ago

argilo commented 2 years ago

Valgrind reports a couple places where data is used before it is initialized:

==12481== Conditional jump or move depends on uninitialised value(s)
==12481==    at 0x11E2D5: setup_mcast (multicast.c:63)
==12481==    by 0x10C70D: loadconfig (main.c:349)
==12481==    by 0x10BB6A: main (main.c:155)

If target is null, then the uninitialized iface will be passed into strlen.

==12481== Conditional jump or move depends on uninitialised value(s)
==12481==    at 0x113092: alloc_demod (radio.c:63)
==12481==    by 0x10C7FF: loadconfig (main.c:372)
==12481==    by 0x10BB6A: main (main.c:155)

The inuse field is read even though Demod_list is not initialized.

I've fixed both problems here.

argilo commented 2 years ago

Closing, since you already manually applied these changes.