Browse Source

leansdr/dvbs2: Fix potential null tabname dereference in s2_fecdec_soft

Move the tabname diagnostic inside the existing null check to prevent
fprintf() from dereferencing a null tabname when an unsupported MODCOD
has no corresponding LDPC table entry.

This resolves the cppcheck nullPointerRedundantCheck warning while
preserving the existing handling of missing table entries.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
chirpmodem-v8.0.0
Robin Getz 3 months ago
parent
commit
e5c1bfd8cf
No known key found for this signature in database
GPG Key ID: 51C7231FFED0E060
  1. 2
      plugins/channelrx/demoddatv/leansdr/dvbs2.h

2
plugins/channelrx/demoddatv/leansdr/dvbs2.h

@ -3106,10 +3106,10 @@ struct s2_fecdec_soft : runnable @@ -3106,10 +3106,10 @@ struct s2_fecdec_soft : runnable
bch_buf{}
{
const char *tabname = ldpctool::LDPCInterface::mc_tabnames[shortframes][modcod];
fprintf(stderr, "s2_fecdec_soft::s2_fecdec_soft: tabname: %s\n", tabname);
if (tabname)
{
fprintf(stderr, "s2_fecdec_soft::s2_fecdec_soft: tabname: %s\n", tabname);
ldpc = ldpctool::create_ldpc((char *)"S2", tabname[0], atoi(tabname + 1));
code = new ldpctool::code_type[ldpc->code_len()];
aligned_buffer = aligned_alloc(sizeof(ldpctool::simd_type), sizeof(ldpctool::simd_type) * ldpc->code_len());

Loading…
Cancel
Save