Bug in rtl_sdr

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/osmocom-sdr@lists.osmocom.org/.

John Tiller tillerja at gmail.com
Tue Apr 14 05:01:50 UTC 2020


I believe there is a bug in rtl_sdr.c at lines 89 and 242.  When 
bytes_to_read == len (or n_read), then bytes_to_read becomes 0 at lines 
101 and 258 and the read never terminates since 0 means infinite read.

I believe the fix is to change lines 89 and 242 to read:

if ((bytes_to_read > 0) && (bytes_to_read <= len)) { // Versus 
bytes_to_read < len

if ((bytes_to_read > 0) && (bytes_to_read <= (uint32_t)n_read)) { // 
Likewise

John Tiller




More information about the osmocom-sdr mailing list