virt-what-1.27-1.fc42

List of Findings

Error: SHELLCHECK_WARNING (CWE-398): [#def1]
/usr/sbin/virt-what:131:8: error[SC1073]: Couldn't parse this test expression. Fix to allow more checks.
#  129|       metadata=$($timeout_cmd_prefix sh -c '( { echo -e "GET /latest/meta-datainstance/instance-type HTTP/1.0\r\nHost: 100.100.100.200\r\n\r" >&3; grep -s 'ebm' <&3 ; } 3<> /dev/tcp/100.100.100.200/80 ) 2>/dev/null')
#  130|       ret_value=$?
#  131|->     if [ $ret_value $timeout_cmp $timeout_return_value ]; then
#  132|           # a timeout occurred when fetching metadata, assuming remote host unaccessible
#  133|           # which means it might be a non-cloud environment, or test environment.

Error: SHELLCHECK_WARNING (CWE-398): [#def2]
/usr/sbin/virt-what:131:21: error[SC1072]: Expected test to end here (don't wrap commands in []/[[]]). Fix any mentioned problems and try again.
#  129|       metadata=$($timeout_cmd_prefix sh -c '( { echo -e "GET /latest/meta-datainstance/instance-type HTTP/1.0\r\nHost: 100.100.100.200\r\n\r" >&3; grep -s 'ebm' <&3 ; } 3<> /dev/tcp/100.100.100.200/80 ) 2>/dev/null')
#  130|       ret_value=$?
#  131|->     if [ $ret_value $timeout_cmp $timeout_return_value ]; then
#  132|           # a timeout occurred when fetching metadata, assuming remote host unaccessible
#  133|           # which means it might be a non-cloud environment, or test environment.

Error: GCC_ANALYZER_WARNING (CWE-457): [#def3]
virt-what-1.27-build/virt-what-1.27/virt-what-cvm.c: scope_hint: In function ‘cpuid’
virt-what-1.27-build/virt-what-1.27/virt-what-cvm.c:32:38: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*ecx’
virt-what-1.27-build/virt-what-1.27/virt-what-cvm.c:105:3: note: in expansion of macro ‘debug’
virt-what-1.27-build/virt-what-1.27/virt-what-cvm.c:105:3: note: in expansion of macro ‘debug’
virt-what-1.27-build/virt-what-1.27/virt-what-cvm.c:105:3: note: in expansion of macro ‘debug’
virt-what-1.27-build/virt-what-1.27/virt-what-cvm.c:105:3: note: in expansion of macro ‘debug’
#   30|   static bool dodebug = false;
#   31|   
#   32|-> #define debug(...) do { if (dodebug) fprintf(stderr, __VA_ARGS__); } while(0)
#   33|   
#   34|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def4]
virt-what-1.27-build/virt-what-1.27/virt-what-cvm.c:108:36: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*ecx’
virt-what-1.27-build/virt-what-1.27/virt-what-cvm.c:105:3: note: in expansion of macro ‘debug’
#  106|     asm volatile ("cpuid"
#  107|                   : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx)
#  108|->                 : "0" (*eax), "2" (*ecx)
#  109|                   : "memory");
#  110|     debug("CPUID result %x %x %x %x\n", *eax, *ebx, *ecx, *edx);

Error: CPPCHECK_WARNING (CWE-758): [#def5]
virt-what-1.27-build/virt-what-1.27/virt-what-cvm.c:274: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  272|     cpuid(&eax, &ebx, &ecx, &edx);
#  273|   
#  274|->   is_hv = ecx & CPUID_FEATURE_HYPERVISOR;
#  275|   
#  276|     debug ("CPUID is hypervisor: %s\n", is_hv ? "yes" : "no");

Scan Properties

analyzer-version-clippy1.82.0
analyzer-version-cppcheck2.16.0
analyzer-version-gcc14.2.1
analyzer-version-gcc-analyzer15.0.0
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-93.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-namevirt-what-1.27-1.fc42
store-results-to/tmp/tmptc3i82xc/virt-what-1.27-1.fc42.tar.xz
time-created2024-11-13 03:31:22
time-finished2024-11-13 03:32:30
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmptc3i82xc/virt-what-1.27-1.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmptc3i82xc/virt-what-1.27-1.fc42.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9