libnet-1.3-8.fc45

List of Findings

Error: SHELLCHECK_WARNING (CWE-563): [#def1]
/usr/bin/libnet-config:13:1: warning[SC2034]: prefix appears unused. Verify use (or export if used externally).
#   11|   #   libnet-config.  Generated from libnet-config.in by configure.
#   12|   
#   13|-> prefix=/usr
#   14|   exec_prefix=/usr
#   15|   includedir=/usr/include

Error: SHELLCHECK_WARNING (CWE-563): [#def2]
/usr/bin/libnet-config:14:1: warning[SC2034]: exec_prefix appears unused. Verify use (or export if used externally).
#   12|   
#   13|   prefix=/usr
#   14|-> exec_prefix=/usr
#   15|   includedir=/usr/include
#   16|   

Error: SHELLCHECK_WARNING (CWE-563): [#def3]
/usr/bin/libnet-config:36:8: warning[SC2034]: optarg appears unused. Verify use (or export if used externally).
#   34|       case "$1" in
#   35|       -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
#   36|->     *) optarg= ;;
#   37|       esac 
#   38|   

Error: GCC_ANALYZER_WARNING (CWE-465): [#def4]
libnet-1.3/src/libnet_build_ip.c:201:16: warning[-Wanalyzer-deref-before-check]: check of ‘*<unknown>.prev’ for NULL after already dereferencing it
libnet-1.3/src/libnet_build_ip.c:47:8: branch_false: following ‘false’ branch (when ‘l’ is non-NULL)...
libnet-1.3/src/libnet_build_ip.c:56:9: branch_false: ...to here
libnet-1.3/src/libnet_build_ip.c:57:8: branch_false: following ‘false’ branch...
libnet-1.3/src/libnet_build_ip.c:62:5: branch_false: ...to here
libnet-1.3/src/libnet_build_ip.c:93:8: branch_false: following ‘false’ branch...
libnet-1.3/src/libnet_build_ip.c:101:8: branch_false: ...to here
libnet-1.3/src/libnet_build_ip.c:132:8: branch_false: following ‘false’ branch...
libnet-1.3/src/libnet_build_ip.c:139:8: branch_false: ...to here
libnet-1.3/src/libnet_build_ip.c:139:8: branch_true: following ‘true’ branch (when ‘payload_s != 0’)...
libnet-1.3/src/libnet_build_ip.c:153:18: branch_true: ...to here
libnet-1.3/src/libnet_build_ip.c:155:12: branch_false: following ‘false’ branch...
libnet-1.3/src/libnet_build_ip.c:160:13: branch_false: ...to here
libnet-1.3/src/libnet_build_ip.c:160:12: branch_false: following ‘false’ branch...
libnet-1.3/src/libnet_build_ip.c:165:12: branch_false: ...to here
libnet-1.3/src/libnet_build_ip.c:165:12: branch_true: following ‘true’ branch (when ‘ptag_data == 0’)...
libnet-1.3/src/libnet_build_ip.c:168:17: branch_true: ...to here
libnet-1.3/src/libnet_build_ip.c:168:16: branch_true: following ‘true’ branch...
libnet-1.3/src/libnet_build_ip.c:170:17: branch_true: ...to here
libnet-1.3/src/libnet_build_ip.c:201:16: danger: pointer ‘*<unknown>.prev’ is checked for NULL here but it was already dereferenced at [(17)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/16)
#  199|               }
#  200|   
#  201|->             if (p_data->prev && p_data->prev->type == LIBNET_PBLOCK_IPO_H)
#  202|               {
#  203|                   libnet_pblock_swap(l, p_data->prev->ptag, p_data->ptag); 

Error: GCC_ANALYZER_WARNING (CWE-457): [#def5]
libnet-1.3/src/libnet_build_udld.c:119:5: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘p’
libnet-1.3/src/libnet_build_udld.c:21:9: branch_false: following ‘false’ branch...
libnet-1.3/src/libnet_build_udld.c:55:9: branch_false: ...to here
libnet-1.3/src/libnet_build_udld.c:119:5: danger: use of uninitialized value ‘p’ here
#  117|       return libnet_pblock_update(l, p, h, pblock_type);
#  118|     bad:
#  119|->     libnet_pblock_delete(l, p);
#  120|       return (-1);
#  121|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
libnet-1.3/src/libnet_if_addr.c:159:19: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
libnet-1.3/src/libnet_if_addr.c:122:8: branch_false: following ‘false’ branch...
libnet-1.3/src/libnet_if_addr.c:128:18: branch_false: ...to here
libnet-1.3/src/libnet_if_addr.c:129:8: branch_false: following ‘false’ branch (when ‘ifaddrlist’ is non-NULL)...
libnet-1.3/src/libnet_if_addr.c:135:10: branch_false: ...to here
libnet-1.3/src/libnet_if_addr.c:135:22: branch_true: following ‘true’ branch (when ‘ifa’ is non-NULL)...
libnet-1.3/src/libnet_if_addr.c:137:52: branch_true: ...to here
libnet-1.3/src/libnet_if_addr.c:145:22: acquire_memory: allocated here
libnet-1.3/src/libnet_if_addr.c:146:12: branch_false: following ‘false’ branch...
libnet-1.3/src/libnet_if_addr.c:151:20: branch_false: ...to here
libnet-1.3/src/libnet_if_addr.c:154:12: branch_true: following ‘true’ branch...
libnet-1.3/src/libnet_if_addr.c:158:28: branch_true: ...to here
libnet-1.3/src/libnet_if_addr.c:159:19: danger: ‘<unknown>’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  157|               /* grow by a factor of 1.5, close enough to golden ratio */
#  158|               ip_addr_num += ip_addr_num >> 2;
#  159|->             tmp = realloc(ifaddrlist, ip_addr_num * sizeof(struct libnet_ifaddr_list));
#  160|               if (!tmp)
#  161|               {

Error: GCC_ANALYZER_WARNING (CWE-457): [#def7]
libnet-1.3/src/libnet_if_addr.c:555:16: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘<unknown>’
libnet-1.3/src/libnet_if_addr.c:553:8: branch_false: following ‘false’ branch (when ‘l’ is non-NULL)...
libnet-1.3/src/libnet_if_addr.c:558:9: branch_false: ...to here
libnet-1.3/src/libnet_if_addr.c:617:8: branch_false: following ‘false’ branch...
libnet-1.3/src/libnet_if_addr.c:555:16: branch_false: ...to here
libnet-1.3/src/libnet_if_addr.c:555:16: danger: use of uninitialized value ‘<unknown>’ here
#  553|       if (l == NULL)
#  554|       { 
#  555|->         return (-1);
#  556|       }
#  557|   

Error: COMPILER_WARNING (CWE-457): [#def8]
libnet-1.3/src/libnet_if_addr.c: scope_hint: In function ‘libnet_select_device’
libnet-1.3/src/libnet_if_addr.c:626:12: warning[-Wmaybe-uninitialized]: ‘rc’ may be used uninitialized
#  626 |     return rc;
#      |            ^~
libnet-1.3/src/libnet_if_addr.c:551:15: note: ‘rc’ was declared here
#  551 |     int c, i, rc;
#      |               ^~
#  624|       }
#  625|   
#  626|->     return rc;
#  627|   }
#  628|   

Error: CPPCHECK_WARNING (CWE-476): [#def9]
libnet-1.3/src/libnet_pblock.c:350: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: *packet
#  348|           /* Avoid allocating zero bytes of memory, it perturbs electric fence. */
#  349|           *packet = malloc(1);
#  350|->         **packet =1;
#  351|       } else {
#  352|           *packet = malloc(l->aligner + l->total_size);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def10]
libnet-1.3/src/libnet_pblock.c:350:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*packet’
libnet-1.3/src/libnet_pblock.c:347:7: branch_true: following ‘true’ branch...
libnet-1.3/src/libnet_pblock.c:349:19: acquire_memory: this call could return NULL
libnet-1.3/src/libnet_pblock.c:350:9: danger: ‘malloc(1)’ could be NULL: unchecked value from [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  348|           /* Avoid allocating zero bytes of memory, it perturbs electric fence. */
#  349|           *packet = malloc(1);
#  350|->         **packet =1;
#  351|       } else {
#  352|           *packet = malloc(l->aligner + l->total_size);

Error: COMPILER_WARNING: [#def11]
libnet-1.3/src/libnet_port_list.c: scope_hint: In function ‘libnet_plist_chain_new’
libnet-1.3/src/libnet_port_list.c:101:19: warning[-Wuse-after-free]: pointer ‘all_lists_tmp_107’ may be used after ‘realloc’
#  101 |         all_lists = all_lists_tmp;
#      |         ~~~~~~~~~~^~~~~~~~~~~~~~~
libnet-1.3/src/libnet_port_list.c:98:17: note: call to ‘realloc’ here
#   98 |     all_lists = realloc(all_lists_tmp, (sizeof(uint16_t) * (cur_id + 1)));
#      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   99|       if (!all_lists)
#  100|       {
#  101|->         all_lists = all_lists_tmp;
#  102|           snprintf(l->err_buf, LIBNET_ERRBUF_SIZE,
#  103|                       "libnet_build_plist_chain: realloc %s", strerror(errno));

Error: COMPILER_WARNING (CWE-563): [#def12]
libnet-1.3/src/libnet_raw.c: scope_hint: In function ‘libnet_finish_setup_socket’
libnet-1.3/src/libnet_raw.c:80:14: warning[-Wunused-variable]: unused variable ‘len’
#   80 |     unsigned len;
#      |              ^~~
#   78|   	BOOL n;
#   79|   #endif
#   80|->     unsigned len;
#   81|   
#   82|   #ifdef SO_BROADCAST

Error: CPPCHECK_WARNING (CWE-457): [#def13]
libnet-1.3/src/libnet_resolve.c:123: error[uninitvar]: Uninitialized variable: addr
#  121|       if (use_name == LIBNET_RESOLVE)
#  122|       {
#  123|->         if ((addr.s_addr = inet_addr(host_name)) == INADDR_NONE)
#  124|           {
#  125|               if (!(host_ent = gethostbyname(host_name)))

Scan Properties

analyzer-version-clippy1.97.1
analyzer-version-cppcheck2.21.1
analyzer-version-gcc16.1.1
analyzer-version-gcc-analyzer16.1.1
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-114.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20260524.213755.g3c6d0be.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namelibnet-1.3-8.fc45
store-results-to/tmp/tmpzyfckwyf/libnet-1.3-8.fc45.tar.xz
time-created2026-08-03 17:39:26
time-finished2026-08-03 17:40:49
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,unicontrol,shellcheck,cppcheck' '-o' '/tmp/tmpzyfckwyf/libnet-1.3-8.fc45.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpzyfckwyf/libnet-1.3-8.fc45.src.rpm'
tool-versioncsmock-3.8.7.20260803.142340.gb75b18e-1.el9