From e5c1bfd8cfbc32051be6f9a4b0b73011d4d30253 Mon Sep 17 00:00:00 2001 From: Robin Getz Date: Tue, 8 Sep 2026 20:27:13 -0400 Subject: [PATCH] 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 --- plugins/channelrx/demoddatv/leansdr/dvbs2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/channelrx/demoddatv/leansdr/dvbs2.h b/plugins/channelrx/demoddatv/leansdr/dvbs2.h index a15870ee1..3d4694176 100644 --- a/plugins/channelrx/demoddatv/leansdr/dvbs2.h +++ b/plugins/channelrx/demoddatv/leansdr/dvbs2.h @@ -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());