libvirt-12.5.0-2.fc45

List of Findings

Error: SHELLCHECK_WARNING: [#def1]
/usr/libexec/libvirt-guests.sh:69:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#   67|   # (using libvirt's default connection)
#   68|   run_virsh() {
#   69|->     local uri="$1"
#   70|       shift
#   71|   

Error: SHELLCHECK_WARNING: [#def2]
/usr/libexec/libvirt-guests.sh:90:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#   88|   test_connect()
#   89|   {
#   90|->     local uri="$1"
#   91|   
#   92|       if run_virsh "$uri" connect 2>/dev/null; then

Error: SHELLCHECK_WARNING: [#def3]
/usr/libexec/libvirt-guests.sh:107:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  105|   # [none]: list both persistent and transient guests
#  106|   list_guests() {
#  107|->     local uri="$1"
#  108|       local persistent="$2"
#  109|       local list

Error: SHELLCHECK_WARNING: [#def4]
/usr/libexec/libvirt-guests.sh:108:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  106|   list_guests() {
#  107|       local uri="$1"
#  108|->     local persistent="$2"
#  109|       local list
#  110|   

Error: SHELLCHECK_WARNING: [#def5]
/usr/libexec/libvirt-guests.sh:109:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  107|       local uri="$1"
#  108|       local persistent="$2"
#  109|->     local list
#  110|   
#  111|       list="$(run_virsh_c "$uri" list --uuid $persistent)"

Error: SHELLCHECK_WARNING: [#def6]
/usr/libexec/libvirt-guests.sh:123:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  121|   # return name of guest UUID on URI
#  122|   guest_name() {
#  123|->     local uri="$1"
#  124|       local uuid="$2"
#  125|   

Error: SHELLCHECK_WARNING: [#def7]
/usr/libexec/libvirt-guests.sh:124:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  122|   guest_name() {
#  123|       local uri="$1"
#  124|->     local uuid="$2"
#  125|   
#  126|       run_virsh "$uri" domname "$uuid" 2>/dev/null

Error: SHELLCHECK_WARNING: [#def8]
/usr/libexec/libvirt-guests.sh:133:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  131|   # Result is returned by variable "guest_running"
#  132|   guest_is_on() {
#  133|->     local uri="$1"
#  134|       local uuid="$2"
#  135|       local id

Error: SHELLCHECK_WARNING: [#def9]
/usr/libexec/libvirt-guests.sh:134:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  132|   guest_is_on() {
#  133|       local uri="$1"
#  134|->     local uuid="$2"
#  135|       local id
#  136|   

Error: SHELLCHECK_WARNING: [#def10]
/usr/libexec/libvirt-guests.sh:135:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  133|       local uri="$1"
#  134|       local uuid="$2"
#  135|->     local id
#  136|   
#  137|       guest_running="false"

Error: SHELLCHECK_WARNING: [#def11]
/usr/libexec/libvirt-guests.sh:157:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  155|   # Start or resume the guests
#  156|   start() {
#  157|->     local isfirst="true"
#  158|       local bypass=
#  159|       local sync_time="false"

Error: SHELLCHECK_WARNING: [#def12]
/usr/libexec/libvirt-guests.sh:158:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  156|   start() {
#  157|       local isfirst="true"
#  158|->     local bypass=
#  159|       local sync_time="false"
#  160|       local uri=

Error: SHELLCHECK_WARNING: [#def13]
/usr/libexec/libvirt-guests.sh:159:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  157|       local isfirst="true"
#  158|       local bypass=
#  159|->     local sync_time="false"
#  160|       local uri=
#  161|       local list=

Error: SHELLCHECK_WARNING: [#def14]
/usr/libexec/libvirt-guests.sh:160:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  158|       local bypass=
#  159|       local sync_time="false"
#  160|->     local uri=
#  161|       local list=
#  162|   

Error: SHELLCHECK_WARNING: [#def15]
/usr/libexec/libvirt-guests.sh:161:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  159|       local sync_time="false"
#  160|       local uri=
#  161|->     local list=
#  162|   
#  163|       [ -f "$LISTFILE" ] || { started; return 0; }

Error: SHELLCHECK_WARNING: [#def16]
/usr/libexec/libvirt-guests.sh:176:9: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  174|       test "x$SYNC_TIME" = x0 || sync_time="true"
#  175|       while read uri list; do
#  176|->         local configured="false"
#  177|           local confuri=
#  178|           local guest=

Error: SHELLCHECK_WARNING: [#def17]
/usr/libexec/libvirt-guests.sh:177:9: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  175|       while read uri list; do
#  176|           local configured="false"
#  177|->         local confuri=
#  178|           local guest=
#  179|   

Error: SHELLCHECK_WARNING: [#def18]
/usr/libexec/libvirt-guests.sh:178:9: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  176|           local configured="false"
#  177|           local confuri=
#  178|->         local guest=
#  179|   
#  180|           set -f

Error: SHELLCHECK_WARNING: [#def19]
/usr/libexec/libvirt-guests.sh:198:13: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  196|           eval_gettext "Resuming guests on \$uri URI..."; echo
#  197|           for guest in $list; do
#  198|->             local name="$(guest_name "$uri" "$guest")"
#  199|               eval_gettext "Resuming guest \$name: "
#  200|               if guest_is_on "$uri" "$guest"; then

Error: SHELLCHECK_WARNING (CWE-571): [#def20]
/usr/libexec/libvirt-guests.sh:198:19: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  196|           eval_gettext "Resuming guests on \$uri URI..."; echo
#  197|           for guest in $list; do
#  198|->             local name="$(guest_name "$uri" "$guest")"
#  199|               eval_gettext "Resuming guest \$name: "
#  200|               if guest_is_on "$uri" "$guest"; then

Error: SHELLCHECK_WARNING: [#def21]
/usr/libexec/libvirt-guests.sh:229:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  227|   suspend_guest()
#  228|   {
#  229|->     local uri="$1"
#  230|       local guest="$2"
#  231|       local name="$(guest_name "$uri" "$guest")"

Error: SHELLCHECK_WARNING: [#def22]
/usr/libexec/libvirt-guests.sh:230:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  228|   {
#  229|       local uri="$1"
#  230|->     local guest="$2"
#  231|       local name="$(guest_name "$uri" "$guest")"
#  232|       local label="$(eval_gettext "Suspending \$name: ")"

Error: SHELLCHECK_WARNING: [#def23]
/usr/libexec/libvirt-guests.sh:231:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  229|       local uri="$1"
#  230|       local guest="$2"
#  231|->     local name="$(guest_name "$uri" "$guest")"
#  232|       local label="$(eval_gettext "Suspending \$name: ")"
#  233|       local bypass=

Error: SHELLCHECK_WARNING (CWE-571): [#def24]
/usr/libexec/libvirt-guests.sh:231:11: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  229|       local uri="$1"
#  230|       local guest="$2"
#  231|->     local name="$(guest_name "$uri" "$guest")"
#  232|       local label="$(eval_gettext "Suspending \$name: ")"
#  233|       local bypass=

Error: SHELLCHECK_WARNING: [#def25]
/usr/libexec/libvirt-guests.sh:232:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  230|       local guest="$2"
#  231|       local name="$(guest_name "$uri" "$guest")"
#  232|->     local label="$(eval_gettext "Suspending \$name: ")"
#  233|       local bypass=
#  234|       local slept=0

Error: SHELLCHECK_WARNING (CWE-571): [#def26]
/usr/libexec/libvirt-guests.sh:232:11: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  230|       local guest="$2"
#  231|       local name="$(guest_name "$uri" "$guest")"
#  232|->     local label="$(eval_gettext "Suspending \$name: ")"
#  233|       local bypass=
#  234|       local slept=0

Error: SHELLCHECK_WARNING: [#def27]
/usr/libexec/libvirt-guests.sh:233:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  231|       local name="$(guest_name "$uri" "$guest")"
#  232|       local label="$(eval_gettext "Suspending \$name: ")"
#  233|->     local bypass=
#  234|       local slept=0
#  235|   

Error: SHELLCHECK_WARNING: [#def28]
/usr/libexec/libvirt-guests.sh:234:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  232|       local label="$(eval_gettext "Suspending \$name: ")"
#  233|       local bypass=
#  234|->     local slept=0
#  235|   
#  236|       test "x$BYPASS_CACHE" = x0 || bypass="--bypass-cache"

Error: SHELLCHECK_WARNING: [#def29]
/usr/libexec/libvirt-guests.sh:239:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  237|       printf '%s...\n' "$label"
#  238|       run_virsh "$uri" managedsave $bypass "$guest" >/dev/null &
#  239|->     local virsh_pid="$!"
#  240|       while true; do
#  241|           sleep 1

Error: SHELLCHECK_WARNING: [#def30]
/usr/libexec/libvirt-guests.sh:246:13: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  244|           slept=$(($slept + 1))
#  245|           if [ $(($slept % 5)) -eq 0 ]; then
#  246|->             local progress="$(run_virsh_c "$uri" domjobinfo "$guest" 2>/dev/null | \
#  247|                       awk '/^Data processed:/{print $3, $4}')"
#  248|               if [ -n "$progress" ]; then

Error: SHELLCHECK_WARNING (CWE-571): [#def31]
/usr/libexec/libvirt-guests.sh:246:19: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  244|           slept=$(($slept + 1))
#  245|           if [ $(($slept % 5)) -eq 0 ]; then
#  246|->             local progress="$(run_virsh_c "$uri" domjobinfo "$guest" 2>/dev/null | \
#  247|                       awk '/^Data processed:/{print $3, $4}')"
#  248|               if [ -n "$progress" ]; then

Error: SHELLCHECK_WARNING: [#def32]
/usr/libexec/libvirt-guests.sh:263:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  261|   shutdown_guest()
#  262|   {
#  263|->     local uri="$1"
#  264|       local guest="$2"
#  265|       local name="$(guest_name "$uri" "$guest")"

Error: SHELLCHECK_WARNING: [#def33]
/usr/libexec/libvirt-guests.sh:264:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  262|   {
#  263|       local uri="$1"
#  264|->     local guest="$2"
#  265|       local name="$(guest_name "$uri" "$guest")"
#  266|       local timeout="$SHUTDOWN_TIMEOUT"

Error: SHELLCHECK_WARNING: [#def34]
/usr/libexec/libvirt-guests.sh:265:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  263|       local uri="$1"
#  264|       local guest="$2"
#  265|->     local name="$(guest_name "$uri" "$guest")"
#  266|       local timeout="$SHUTDOWN_TIMEOUT"
#  267|       local check_timeout="false"

Error: SHELLCHECK_WARNING (CWE-571): [#def35]
/usr/libexec/libvirt-guests.sh:265:11: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  263|       local uri="$1"
#  264|       local guest="$2"
#  265|->     local name="$(guest_name "$uri" "$guest")"
#  266|       local timeout="$SHUTDOWN_TIMEOUT"
#  267|       local check_timeout="false"

Error: SHELLCHECK_WARNING: [#def36]
/usr/libexec/libvirt-guests.sh:266:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  264|       local guest="$2"
#  265|       local name="$(guest_name "$uri" "$guest")"
#  266|->     local timeout="$SHUTDOWN_TIMEOUT"
#  267|       local check_timeout="false"
#  268|       local format=

Error: SHELLCHECK_WARNING: [#def37]
/usr/libexec/libvirt-guests.sh:267:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  265|       local name="$(guest_name "$uri" "$guest")"
#  266|       local timeout="$SHUTDOWN_TIMEOUT"
#  267|->     local check_timeout="false"
#  268|       local format=
#  269|       local slept=

Error: SHELLCHECK_WARNING: [#def38]
/usr/libexec/libvirt-guests.sh:268:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  266|       local timeout="$SHUTDOWN_TIMEOUT"
#  267|       local check_timeout="false"
#  268|->     local format=
#  269|       local slept=
#  270|   

Error: SHELLCHECK_WARNING: [#def39]
/usr/libexec/libvirt-guests.sh:269:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  267|       local check_timeout="false"
#  268|       local format=
#  269|->     local slept=
#  270|   
#  271|       eval_gettext "Starting shutdown on guest: \$name"

Error: SHELLCHECK_WARNING: [#def40]
/usr/libexec/libvirt-guests.sh:315:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  313|   shutdown_guest_async()
#  314|   {
#  315|->     local uri="$1"
#  316|       local guest="$2"
#  317|       local name="$(guest_name "$uri" "$guest")"

Error: SHELLCHECK_WARNING: [#def41]
/usr/libexec/libvirt-guests.sh:316:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  314|   {
#  315|       local uri="$1"
#  316|->     local guest="$2"
#  317|       local name="$(guest_name "$uri" "$guest")"
#  318|   

Error: SHELLCHECK_WARNING: [#def42]
/usr/libexec/libvirt-guests.sh:317:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  315|       local uri="$1"
#  316|       local guest="$2"
#  317|->     local name="$(guest_name "$uri" "$guest")"
#  318|   
#  319|       eval_gettext "Starting shutdown on guest: \$name"

Error: SHELLCHECK_WARNING (CWE-571): [#def43]
/usr/libexec/libvirt-guests.sh:317:11: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  315|       local uri="$1"
#  316|       local guest="$2"
#  317|->     local name="$(guest_name "$uri" "$guest")"
#  318|   
#  319|       eval_gettext "Starting shutdown on guest: \$name"

Error: SHELLCHECK_WARNING: [#def44]
/usr/libexec/libvirt-guests.sh:338:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  336|   check_guests_shutdown()
#  337|   {
#  338|->     local uri="$1"
#  339|       local guests_to_check="$2"
#  340|       local guest=

Error: SHELLCHECK_WARNING: [#def45]
/usr/libexec/libvirt-guests.sh:339:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  337|   {
#  338|       local uri="$1"
#  339|->     local guests_to_check="$2"
#  340|       local guest=
#  341|   

Error: SHELLCHECK_WARNING: [#def46]
/usr/libexec/libvirt-guests.sh:340:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  338|       local uri="$1"
#  339|       local guests_to_check="$2"
#  340|->     local guest=
#  341|   
#  342|       guests_shutting_down=

Error: SHELLCHECK_WARNING: [#def47]
/usr/libexec/libvirt-guests.sh:360:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  358|   print_guests_shutdown()
#  359|   {
#  360|->     local uri="$1"
#  361|       local before="$2"
#  362|       local after="$3"

Error: SHELLCHECK_WARNING: [#def48]
/usr/libexec/libvirt-guests.sh:361:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  359|   {
#  360|       local uri="$1"
#  361|->     local before="$2"
#  362|       local after="$3"
#  363|       local guest=

Error: SHELLCHECK_WARNING: [#def49]
/usr/libexec/libvirt-guests.sh:362:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  360|       local uri="$1"
#  361|       local before="$2"
#  362|->     local after="$3"
#  363|       local guest=
#  364|   

Error: SHELLCHECK_WARNING: [#def50]
/usr/libexec/libvirt-guests.sh:363:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  361|       local before="$2"
#  362|       local after="$3"
#  363|->     local guest=
#  364|   
#  365|       for guest in $before; do

Error: SHELLCHECK_WARNING: [#def51]
/usr/libexec/libvirt-guests.sh:370:9: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  368|           esac
#  369|   
#  370|->         local name="$(guest_name "$uri" "$guest")"
#  371|           if [ -n "$name" ]; then
#  372|               eval_gettext "Shutdown of guest \$name complete."

Error: SHELLCHECK_WARNING (CWE-571): [#def52]
/usr/libexec/libvirt-guests.sh:370:15: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  368|           esac
#  369|   
#  370|->         local name="$(guest_name "$uri" "$guest")"
#  371|           if [ -n "$name" ]; then
#  372|               eval_gettext "Shutdown of guest \$name complete."

Error: SHELLCHECK_WARNING: [#def53]
/usr/libexec/libvirt-guests.sh:382:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  380|   shutdown_guests_parallel()
#  381|   {
#  382|->     local uri="$1"
#  383|       local guests="$2"
#  384|       local on_shutdown=

Error: SHELLCHECK_WARNING: [#def54]
/usr/libexec/libvirt-guests.sh:383:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  381|   {
#  382|       local uri="$1"
#  383|->     local guests="$2"
#  384|       local on_shutdown=
#  385|       local check_timeout="false"

Error: SHELLCHECK_WARNING: [#def55]
/usr/libexec/libvirt-guests.sh:384:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  382|       local uri="$1"
#  383|       local guests="$2"
#  384|->     local on_shutdown=
#  385|       local check_timeout="false"
#  386|       local timeout="$SHUTDOWN_TIMEOUT"

Error: SHELLCHECK_WARNING: [#def56]
/usr/libexec/libvirt-guests.sh:385:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  383|       local guests="$2"
#  384|       local on_shutdown=
#  385|->     local check_timeout="false"
#  386|       local timeout="$SHUTDOWN_TIMEOUT"
#  387|       local slept=

Error: SHELLCHECK_WARNING: [#def57]
/usr/libexec/libvirt-guests.sh:386:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  384|       local on_shutdown=
#  385|       local check_timeout="false"
#  386|->     local timeout="$SHUTDOWN_TIMEOUT"
#  387|       local slept=
#  388|       local format=

Error: SHELLCHECK_WARNING: [#def58]
/usr/libexec/libvirt-guests.sh:387:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  385|       local check_timeout="false"
#  386|       local timeout="$SHUTDOWN_TIMEOUT"
#  387|->     local slept=
#  388|       local format=
#  389|   

Error: SHELLCHECK_WARNING: [#def59]
/usr/libexec/libvirt-guests.sh:388:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  386|       local timeout="$SHUTDOWN_TIMEOUT"
#  387|       local slept=
#  388|->     local format=
#  389|   
#  390|       if [ $timeout -gt 0 ]; then

Error: SHELLCHECK_WARNING (CWE-156): [#def60]
/usr/libexec/libvirt-guests.sh:399:17: warning[SC2046]: Quote this to prevent word splitting.
#  397|       while [ -n "$on_shutdown" ] || [ -n "$guests" ]; do
#  398|           while [ -n "$guests" ] &&
#  399|->               [ $(guest_count "$on_shutdown") -lt "$PARALLEL_SHUTDOWN" ]; do
#  400|               set -- $guests
#  401|               local guest="$1"

Error: SHELLCHECK_WARNING: [#def61]
/usr/libexec/libvirt-guests.sh:401:13: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  399|                 [ $(guest_count "$on_shutdown") -lt "$PARALLEL_SHUTDOWN" ]; do
#  400|               set -- $guests
#  401|->             local guest="$1"
#  402|               shift
#  403|               guests="$*"

Error: SHELLCHECK_WARNING: [#def62]
/usr/libexec/libvirt-guests.sh:413:9: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  411|   
#  412|           set -- $guests
#  413|->         local guestcount=$#
#  414|           set -- $on_shutdown
#  415|           local shutdowncount=$#

Error: SHELLCHECK_WARNING: [#def63]
/usr/libexec/libvirt-guests.sh:415:9: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  413|           local guestcount=$#
#  414|           set -- $on_shutdown
#  415|->         local shutdowncount=$#
#  416|   
#  417|           if $check_timeout; then

Error: SHELLCHECK_WARNING: [#def64]
/usr/libexec/libvirt-guests.sh:434:9: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  432|           fi
#  433|   
#  434|->         local on_shutdown_prev="$on_shutdown"
#  435|           check_guests_shutdown "$uri" "$on_shutdown"
#  436|           on_shutdown="$guests_shutting_down"

Error: SHELLCHECK_WARNING: [#def65]
/usr/libexec/libvirt-guests.sh:444:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  442|   # Shutdown or save guests on the configured uris
#  443|   stop() {
#  444|->     local uri=
#  445|       local action="suspend"
#  446|       local persistent_only="default"

Error: SHELLCHECK_WARNING: [#def66]
/usr/libexec/libvirt-guests.sh:445:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  443|   stop() {
#  444|       local uri=
#  445|->     local action="suspend"
#  446|       local persistent_only="default"
#  447|   

Error: SHELLCHECK_WARNING: [#def67]
/usr/libexec/libvirt-guests.sh:446:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  444|       local uri=
#  445|       local action="suspend"
#  446|->     local persistent_only="default"
#  447|   
#  448|   

Error: SHELLCHECK_WARNING: [#def68]
/usr/libexec/libvirt-guests.sh:487:9: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  485|           eval_gettext "Running guests on \$uri URI: "
#  486|   
#  487|->         local list
#  488|           list="$(list_guests "$uri")"
#  489|           if [ $? -eq 0 ]; then

Error: SHELLCHECK_WARNING: [#def69]
/usr/libexec/libvirt-guests.sh:490:13: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  488|           list="$(list_guests "$uri")"
#  489|           if [ $? -eq 0 ]; then
#  490|->             local empty=true
#  491|               for uuid in $list; do
#  492|                   "$empty" || printf ", "

Error: SHELLCHECK_WARNING: [#def70]
/usr/libexec/libvirt-guests.sh:504:13: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  502|   
#  503|           if "$persistent_only"; then
#  504|->             local transient
#  505|               transient="$(list_guests "$uri" "--transient")"
#  506|               if [ $? -eq 0 ]; then

Error: SHELLCHECK_WARNING: [#def71]
/usr/libexec/libvirt-guests.sh:507:17: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  505|               transient="$(list_guests "$uri" "--transient")"
#  506|               if [ $? -eq 0 ]; then
#  507|->                 local empty="true"
#  508|                   local uuid=
#  509|   

Error: SHELLCHECK_WARNING: [#def72]
/usr/libexec/libvirt-guests.sh:508:17: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  506|               if [ $? -eq 0 ]; then
#  507|                   local empty="true"
#  508|->                 local uuid=
#  509|   
#  510|                   for uuid in $transient; do

Error: SHELLCHECK_WARNING: [#def73]
/usr/libexec/libvirt-guests.sh:560:17: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  558|                   shutdown_guests_parallel "$uri" "$list"
#  559|               else
#  560|->                 local guest=
#  561|                   for guest in $list; do
#  562|                       if [ "x$action" = xsuspend ]; then

Error: SHELLCHECK_WARNING: [#def74]
/usr/libexec/libvirt-guests.sh:580:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  578|   # List status of guests
#  579|   gueststatus() {
#  580|->     local uri=
#  581|       set -f
#  582|       for uri in $URIS; do

Error: SHELLCHECK_WARNING: [#def75]
/usr/libexec/libvirt-guests.sh:612:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  610|   # Display usage string, then exit with VAL (defaults to 2).
#  611|   usage() {
#  612|->     local program_name="$0"
#  613|       eval_gettext "Usage: \$program_name {start|stop|status|restart|"\
#  614|   "condrestart|try-restart|reload|force-reload|gueststatus|shutdown}"; echo

Error: SHELLCHECK_WARNING (CWE-563): [#def76]
/usr/libexec/libvirt-guests.sh:612:11: warning[SC2034]: program_name appears unused. Verify use (or export if used externally).
#  610|   # Display usage string, then exit with VAL (defaults to 2).
#  611|   usage() {
#  612|->     local program_name="$0"
#  613|       eval_gettext "Usage: \$program_name {start|stop|status|restart|"\
#  614|   "condrestart|try-restart|reload|force-reload|gueststatus|shutdown}"; echo

Error: SHELLCHECK_WARNING (CWE-149): [#def77]
/usr/libexec/libvirt-guests.sh:613:69: warning[SC2140]: Word is of the form "A"B"C" (B indicated). Did you mean "ABC" or "A\"B\"C"?
#  611|   usage() {
#  612|       local program_name="$0"
#  613|->     eval_gettext "Usage: \$program_name {start|stop|status|restart|"\
#  614|   "condrestart|try-restart|reload|force-reload|gueststatus|shutdown}"; echo
#  615|       exit ${1-2}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def78]
libvirt-12.5.0/src/ch/ch_driver.c:1861:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘vcpuinfo’
libvirt-12.5.0/src/ch/ch_driver.c:1822:5: branch_false: following ‘false’ branch (when ‘__unsuppflags == 0’)...
libvirt-12.5.0/src/ch/ch_driver.c:1825:11: branch_false: ...to here
libvirt-12.5.0/src/ch/ch_driver.c:1827:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/ch/ch_driver.c:1830:9: branch_false: ...to here
libvirt-12.5.0/src/ch/ch_driver.c:1830:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/ch/ch_driver.c:1833:9: branch_false: ...to here
libvirt-12.5.0/src/ch/ch_driver.c:1833:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/ch/ch_driver.c:1836:9: branch_false: ...to here
libvirt-12.5.0/src/ch/ch_driver.c:1836:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/ch/ch_driver.c:1839:9: branch_false: ...to here
libvirt-12.5.0/src/ch/ch_driver.c:1839:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/ch/ch_driver.c:1847:21: branch_false: ...to here
libvirt-12.5.0/src/ch/ch_driver.c:1847:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/ch/ch_driver.c:1850:9: branch_false: ...to here
libvirt-12.5.0/src/ch/ch_driver.c:1850:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/ch/ch_driver.c:1856:9: branch_false: ...to here
libvirt-12.5.0/src/ch/ch_driver.c:1860:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/ch/ch_driver.c:1861:9: branch_true: ...to here
libvirt-12.5.0/src/ch/ch_driver.c:1861:9: danger: dereference of NULL ‘vcpuinfo’
# 1859|   
# 1860|       if (persistentDef) {
# 1861|->         virBitmapFree(vcpuinfo->cpumask);
# 1862|           vcpuinfo->cpumask = g_steal_pointer(&pcpumap);
# 1863|           goto endjob;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def79]
libvirt-12.5.0/src/conf/nwfilter_params.c:416:13: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-12.5.0/src/conf/nwfilter_params.c:393:1: enter_function: entry to ‘virNWFilterVarCombIterEntryAreUniqueEntries’
libvirt-12.5.0/src/conf/nwfilter_params.c:402:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/conf/nwfilter_params.c:408:13: branch_false: ...to here
libvirt-12.5.0/src/conf/nwfilter_params.c:408:13: call_function: calling ‘virNWFilterVarValueGetNthValue’ from ‘virNWFilterVarCombIterEntryAreUniqueEntries’
libvirt-12.5.0/src/conf/nwfilter_params.c:408:13: return_function: returning to ‘virNWFilterVarCombIterEntryAreUniqueEntries’ from ‘virNWFilterVarValueGetNthValue’
libvirt-12.5.0/src/conf/nwfilter_params.c:409:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/conf/nwfilter_params.c:409:8: branch_false: ...to here
libvirt-12.5.0/src/conf/nwfilter_params.c:415:17: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/conf/nwfilter_params.c:416:13: branch_true: ...to here
libvirt-12.5.0/src/conf/nwfilter_params.c:416:13: call_function: calling ‘virNWFilterVarValueGetNthValue’ from ‘virNWFilterVarCombIterEntryAreUniqueEntries’
libvirt-12.5.0/src/conf/nwfilter_params.c:416:13: return_function: returning to ‘virNWFilterVarCombIterEntryAreUniqueEntries’ from ‘virNWFilterVarValueGetNthValue’
libvirt-12.5.0/src/conf/nwfilter_params.c:415:17: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/conf/nwfilter_params.c:416:13: branch_true: ...to here
libvirt-12.5.0/src/conf/nwfilter_params.c:416:13: call_function: calling ‘virNWFilterVarValueGetNthValue’ from ‘virNWFilterVarCombIterEntryAreUniqueEntries’
libvirt-12.5.0/src/conf/nwfilter_params.c:416:13: return_function: returning to ‘virNWFilterVarCombIterEntryAreUniqueEntries’ from ‘virNWFilterVarValueGetNthValue’
libvirt-12.5.0/src/conf/nwfilter_params.c:416:13: danger: argument 2 (‘virNWFilterVarValueGetNthValue(virHashLookup(hash, *cie_28(D)->varNames), (unsigned int)i)’) NULL where non-null expected
#  414|   
#  415|       for (i = 0; i < cie->curValue; i++) {
#  416|->         if (STREQ(value, virNWFilterVarValueGetNthValue(varValue, i))) {
#  417|               bool isSame = true;
#  418|               for (j = 1; j < cie->nVarNames; j++) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def80]
libvirt-12.5.0/src/conf/nwfilter_params.c:424:21: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-12.5.0/src/conf/nwfilter_params.c:393:1: enter_function: entry to ‘virNWFilterVarCombIterEntryAreUniqueEntries’
libvirt-12.5.0/src/conf/nwfilter_params.c:402:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/conf/nwfilter_params.c:408:13: branch_false: ...to here
libvirt-12.5.0/src/conf/nwfilter_params.c:408:13: call_function: calling ‘virNWFilterVarValueGetNthValue’ from ‘virNWFilterVarCombIterEntryAreUniqueEntries’
libvirt-12.5.0/src/conf/nwfilter_params.c:408:13: return_function: returning to ‘virNWFilterVarCombIterEntryAreUniqueEntries’ from ‘virNWFilterVarValueGetNthValue’
libvirt-12.5.0/src/conf/nwfilter_params.c:409:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/conf/nwfilter_params.c:409:8: branch_false: ...to here
libvirt-12.5.0/src/conf/nwfilter_params.c:415:17: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/conf/nwfilter_params.c:416:13: branch_true: ...to here
libvirt-12.5.0/src/conf/nwfilter_params.c:416:13: call_function: calling ‘virNWFilterVarValueGetNthValue’ from ‘virNWFilterVarCombIterEntryAreUniqueEntries’
libvirt-12.5.0/src/conf/nwfilter_params.c:416:13: return_function: returning to ‘virNWFilterVarCombIterEntryAreUniqueEntries’ from ‘virNWFilterVarValueGetNthValue’
libvirt-12.5.0/src/conf/nwfilter_params.c:416:12: branch_true: following ‘true’ branch (when the strings are equal)...
libvirt-12.5.0/src/conf/nwfilter_params.c:416:12: branch_true: ...to here
libvirt-12.5.0/src/conf/nwfilter_params.c:418:25: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/conf/nwfilter_params.c:419:43: branch_true: ...to here
libvirt-12.5.0/src/conf/nwfilter_params.c:420:20: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/conf/nwfilter_params.c:424:21: branch_false: ...to here
libvirt-12.5.0/src/conf/nwfilter_params.c:424:21: call_function: calling ‘virNWFilterVarValueGetNthValue’ from ‘virNWFilterVarCombIterEntryAreUniqueEntries’
libvirt-12.5.0/src/conf/nwfilter_params.c:424:21: return_function: returning to ‘virNWFilterVarCombIterEntryAreUniqueEntries’ from ‘virNWFilterVarValueGetNthValue’
libvirt-12.5.0/src/conf/nwfilter_params.c:424:21: call_function: calling ‘virNWFilterVarValueGetNthValue’ from ‘virNWFilterVarCombIterEntryAreUniqueEntries’
libvirt-12.5.0/src/conf/nwfilter_params.c:424:21: return_function: returning to ‘virNWFilterVarCombIterEntryAreUniqueEntries’ from ‘virNWFilterVarValueGetNthValue’
libvirt-12.5.0/src/conf/nwfilter_params.c:424:21: danger: argument 1 (‘virNWFilterVarValueGetNthValue(virHashLookup(hash, *<unknown>), *cie.curValue)’) NULL where non-null expected
#  422|                       return true;
#  423|                   }
#  424|->                 if (STRNEQ(virNWFilterVarValueGetNthValue(tmp, cie->curValue),
#  425|                              virNWFilterVarValueGetNthValue(tmp, i))) {
#  426|                       isSame = false;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def81]
libvirt-12.5.0/src/conf/virchrdev.c:77:16: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-12.5.0/src/conf/virchrdev.c:66:14: enter_function: entry to ‘virChrdevLockFilePath’
libvirt-12.5.0/src/conf/virchrdev.c:77:16: danger: argument 1 (‘<unknown>’) NULL where non-null expected
#   75|   
#   76|       /* skip the leading "/dev/" */
#   77|->     filename = STRSKIP(devCopy, "/dev");
#   78|       if (!filename)
#   79|           filename = devCopy;

Error: GCC_ANALYZER_WARNING (CWE-465): [#def82]
libvirt-12.5.0/src/conf/virstorageobj.c:1387:12: warning[-Wanalyzer-deref-before-check]: check of ‘obj’ for NULL after already dereferencing it
libvirt-12.5.0/src/conf/virstorageobj.c:1378:1: enter_function: entry to ‘virStoragePoolObjSourceMatchTypeDEVICE’
libvirt-12.5.0/src/conf/virstorageobj.c:1383:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/conf/virstorageobj.c:1384:13: branch_true: ...to here
libvirt-12.5.0/src/conf/virstorageobj.c:1384:12: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/conf/virstorageobj.c:1387:25: branch_false: ...to here
libvirt-12.5.0/src/conf/virstorageobj.c:1387:25: call_function: calling ‘virStoragePoolSourceFindDuplicateDevices’ from ‘virStoragePoolObjSourceMatchTypeDEVICE’
libvirt-12.5.0/src/conf/virstorageobj.c:1387:25: return_function: returning to ‘virStoragePoolObjSourceMatchTypeDEVICE’ from ‘virStoragePoolSourceFindDuplicateDevices’
libvirt-12.5.0/src/conf/virstorageobj.c:1387:12: danger: pointer ‘obj’ is checked for NULL here but it was already dereferenced at [(2)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/1)
# 1385|               return NULL;
# 1386|   
# 1387|->         if ((matchobj = virStoragePoolSourceFindDuplicateDevices(obj, def))) {
# 1388|               if (!virStoragePoolSourceISCSIMatch(matchobj, def))
# 1389|                   return NULL;

Error: GCC_ANALYZER_WARNING (CWE-465): [#def83]
libvirt-12.5.0/src/conf/virstorageobj.c:1426:13: warning[-Wanalyzer-deref-before-check]: check of ‘payload’ for NULL after already dereferencing it
libvirt-12.5.0/src/conf/virstorageobj.c:1410:1: enter_function: entry to ‘virStoragePoolObjSourceFindDuplicateCb’
libvirt-12.5.0/src/conf/virstorageobj.c:1419:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
libvirt-12.5.0/src/conf/virstorageobj.c:1422:33: branch_false: ...to here
libvirt-12.5.0/src/conf/virstorageobj.c:1426:12: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/conf/virstorageobj.c:1427:13: branch_true: ...to here
libvirt-12.5.0/src/conf/virstorageobj.c:1427:13: call_function: calling ‘virStoragePoolObjSourceMatchTypeDIR’ from ‘virStoragePoolObjSourceFindDuplicateCb’
libvirt-12.5.0/src/conf/virstorageobj.c:1427:13: return_function: returning to ‘virStoragePoolObjSourceFindDuplicateCb’ from ‘virStoragePoolObjSourceMatchTypeDIR’
libvirt-12.5.0/src/conf/virstorageobj.c:1426:13: danger: pointer ‘payload’ is checked for NULL here but it was already dereferenced at [(2)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/1)
# 1424|       case VIR_STORAGE_POOL_GLUSTER:
# 1425|       case VIR_STORAGE_POOL_NETFS:
# 1426|->         if (data->def->type == obj->def->type &&
# 1427|               virStoragePoolObjSourceMatchTypeDIR(obj, data->def))
# 1428|               return 1;

Error: GCC_ANALYZER_WARNING (CWE-465): [#def84]
libvirt-12.5.0/src/conf/virstorageobj.c:1432:13: warning[-Wanalyzer-deref-before-check]: check of ‘payload’ for NULL after already dereferencing it
libvirt-12.5.0/src/conf/virstorageobj.c:1410:1: enter_function: entry to ‘virStoragePoolObjSourceFindDuplicateCb’
libvirt-12.5.0/src/conf/virstorageobj.c:1419:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
libvirt-12.5.0/src/conf/virstorageobj.c:1422:33: branch_false: ...to here
libvirt-12.5.0/src/conf/virstorageobj.c:1432:12: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/conf/virstorageobj.c:1433:13: branch_true: ...to here
libvirt-12.5.0/src/conf/virstorageobj.c:1433:13: call_function: calling ‘virStoragePoolObjSourceMatchTypeISCSI’ from ‘virStoragePoolObjSourceFindDuplicateCb’
libvirt-12.5.0/src/conf/virstorageobj.c:1433:13: return_function: returning to ‘virStoragePoolObjSourceFindDuplicateCb’ from ‘virStoragePoolObjSourceMatchTypeISCSI’
libvirt-12.5.0/src/conf/virstorageobj.c:1432:13: danger: pointer ‘payload’ is checked for NULL here but it was already dereferenced at [(2)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/1)
# 1430|   
# 1431|       case VIR_STORAGE_POOL_SCSI:
# 1432|->         if (data->def->type == obj->def->type &&
# 1433|               virStoragePoolObjSourceMatchTypeISCSI(obj, data->def))
# 1434|               return 1;

Error: GCC_ANALYZER_WARNING (CWE-465): [#def85]
libvirt-12.5.0/src/conf/virstorageobj.c:1442:13: warning[-Wanalyzer-deref-before-check]: check of ‘payload’ for NULL after already dereferencing it
libvirt-12.5.0/src/conf/virstorageobj.c:1410:1: enter_function: entry to ‘virStoragePoolObjSourceFindDuplicateCb’
libvirt-12.5.0/src/conf/virstorageobj.c:1419:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
libvirt-12.5.0/src/conf/virstorageobj.c:1422:33: branch_false: ...to here
libvirt-12.5.0/src/conf/virstorageobj.c:1447:13: call_function: calling ‘virStoragePoolObjSourceMatchTypeDEVICE’ from ‘virStoragePoolObjSourceFindDuplicateCb’
libvirt-12.5.0/src/conf/virstorageobj.c:1447:13: return_function: returning to ‘virStoragePoolObjSourceFindDuplicateCb’ from ‘virStoragePoolObjSourceMatchTypeDEVICE’
libvirt-12.5.0/src/conf/virstorageobj.c:1442:13: danger: pointer ‘payload’ is checked for NULL here but it was already dereferenced at [(2)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/1)
# 1440|       case VIR_STORAGE_POOL_DISK:
# 1441|       case VIR_STORAGE_POOL_ZFS:
# 1442|->         if ((data->def->type == VIR_STORAGE_POOL_ISCSI ||
# 1443|                data->def->type == VIR_STORAGE_POOL_FS ||
# 1444|                data->def->type == VIR_STORAGE_POOL_LOGICAL ||

Error: GCC_ANALYZER_WARNING (CWE-476): [#def86]
libvirt-12.5.0/src/esx/esx_util.c:232:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘saveptr’
libvirt-12.5.0/src/esx/esx_util.c:212:1: enter_function: entry to ‘esxUtil_ParseDatastorePath’
libvirt-12.5.0/src/esx/esx_util.c:218:11: release_memory: ‘saveptr’ is NULL
libvirt-12.5.0/src/esx/esx_util.c:232:17: danger: dereference of NULL ‘<unknown>’
#  230|   
#  231|       /* Expected format: '[<datastore>] <path>' where <path> is optional */
#  232|->     if (!(tmp = STRSKIP(copyOfDatastorePath, "[")) || *tmp == ']' ||
#  233|           !(preliminaryDatastoreName = strtok_r(tmp, "]", &saveptr))) {
#  234|           virReportError(VIR_ERR_INVALID_ARG,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def87]
libvirt-12.5.0/src/esx/esx_util.c:412:12: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘tmp’
libvirt-12.5.0/src/esx/esx_util.c:427:1: enter_function: entry to ‘esxUtil_EscapeDatastoreItem’
libvirt-12.5.0/src/esx/esx_util.c:434:5: call_function: calling ‘esxUtil_ReplaceSpecialWindowsPathChars’ from ‘esxUtil_EscapeDatastoreItem’
#  410|       size_t length;
#  411|   
#  412|->     while (*tmp != '\0') {
#  413|           length = strspn(tmp, specials);
#  414|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def88]
libvirt-12.5.0/src/hyperv/hyperv_driver.c:841:45: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘driveSettings’
libvirt-12.5.0/src/hyperv/hyperv_driver.c:2989:1: enter_function: entry to ‘hypervDomainDefineXMLFlags’
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3004:5: branch_false: following ‘false’ branch (when ‘__unsuppflags == 0’)...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3006:8: branch_false: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3011:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3015:19: branch_false: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3035:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3038:25: branch_false: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3040:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3044:9: branch_false: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3061:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3065:45: branch_false: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3065:14: call_function: calling ‘hypervDomainLookupByName’ from ‘hypervDomainDefineXMLFlags’
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3065:14: return_function: returning to ‘hypervDomainDefineXMLFlags’ from ‘hypervDomainLookupByName’
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3068:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3072:9: branch_false: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3072:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3076:9: branch_false: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3076:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3080:9: branch_false: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3080:9: call_function: calling ‘hypervDomainAttachStorage’ from ‘hypervDomainDefineXMLFlags’
#  839|           return -1;
#  840|   
#  841|->     vhdInstanceIdEscaped = virStringReplace(driveSettings->data->InstanceID, "\\", "\\\\");
#  842|       vfd__PATH = g_strdup_printf("\\\\%s\\Root\\Virtualization\\V2:"
#  843|                                   "Msvm_ResourceAllocationSettingData.InstanceID=\"%s\"",

Error: GCC_ANALYZER_WARNING (CWE-476): [#def89]
libvirt-12.5.0/src/hyperv/hyperv_driver.c:906:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘domain’
libvirt-12.5.0/src/hyperv/hyperv_driver.c:2989:1: enter_function: entry to ‘hypervDomainDefineXMLFlags’
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3004:5: branch_false: following ‘false’ branch (when ‘__unsuppflags == 0’)...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3006:8: branch_false: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3011:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3015:19: branch_false: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3035:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3038:25: branch_false: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3040:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3044:9: branch_false: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3061:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3065:45: branch_false: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3065:14: call_function: calling ‘hypervDomainLookupByName’ from ‘hypervDomainDefineXMLFlags’
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3065:14: return_function: returning to ‘hypervDomainDefineXMLFlags’ from ‘hypervDomainLookupByName’
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3068:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3072:9: branch_false: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3072:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3076:9: branch_false: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3076:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3080:9: branch_false: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3080:9: call_function: calling ‘hypervDomainAttachStorage’ from ‘hypervDomainDefineXMLFlags’
#  904|   hypervDomainAttachStorage(virDomainPtr domain, virDomainDef *def, const char *hostname)
#  905|   {
#  906|->     hypervPrivate *priv = domain->conn->privateData;
#  907|       size_t i = 0;
#  908|       char uuid_string[VIR_UUID_STRING_BUFLEN];

Error: GCC_ANALYZER_WARNING (CWE-476): [#def90]
libvirt-12.5.0/src/hyperv/hyperv_driver.c:2269:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘domain’
libvirt-12.5.0/src/hyperv/hyperv_driver.c:2989:1: enter_function: entry to ‘hypervDomainDefineXMLFlags’
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3004:5: branch_false: following ‘false’ branch (when ‘__unsuppflags == 0’)...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3006:8: branch_false: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3011:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3015:19: branch_false: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3035:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3038:25: branch_false: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3040:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3044:9: branch_false: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3061:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3065:45: branch_false: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3065:14: call_function: calling ‘hypervDomainLookupByName’ from ‘hypervDomainDefineXMLFlags’
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3065:14: return_function: returning to ‘hypervDomainDefineXMLFlags’ from ‘hypervDomainLookupByName’
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3068:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3072:9: branch_false: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3072:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3072:36: call_function: inlined call to ‘hypervDomainSetMaxMemory’ from ‘hypervDomainDefineXMLFlags’
# 2267|   {
# 2268|       char uuid_string[VIR_UUID_STRING_BUFLEN];
# 2269|->     hypervPrivate *priv = domain->conn->privateData;
# 2270|       g_autoptr(Msvm_VirtualSystemSettingData) vssd = NULL;
# 2271|       g_autoptr(Msvm_MemorySettingData) memsd = NULL;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def91]
libvirt-12.5.0/src/hyperv/hyperv_driver.c:2527:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘domain’
libvirt-12.5.0/src/hyperv/hyperv_driver.c:2989:1: enter_function: entry to ‘hypervDomainDefineXMLFlags’
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3004:5: branch_false: following ‘false’ branch (when ‘__unsuppflags == 0’)...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3006:8: branch_false: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3011:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3015:19: branch_false: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3035:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3038:25: branch_false: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3040:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3044:9: branch_false: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3061:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3065:45: branch_false: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3065:14: call_function: calling ‘hypervDomainLookupByName’ from ‘hypervDomainDefineXMLFlags’
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3065:14: return_function: returning to ‘hypervDomainDefineXMLFlags’ from ‘hypervDomainLookupByName’
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3068:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3068:52: branch_true: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:3068:23: call_function: inlined call to ‘hypervDomainSetVcpus’ from ‘hypervDomainDefineXMLFlags’
# 2525|   {
# 2526|       char uuid_string[VIR_UUID_STRING_BUFLEN];
# 2527|->     hypervPrivate *priv = domain->conn->privateData;
# 2528|       g_autoptr(Msvm_VirtualSystemSettingData) vssd = NULL;
# 2529|       g_autoptr(Msvm_ProcessorSettingData) proc_sd = NULL;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def92]
libvirt-12.5.0/src/hyperv/hyperv_driver.c:4375:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘snapshotsRet’
libvirt-12.5.0/src/hyperv/hyperv_driver.c:4327:5: branch_false: following ‘false’ branch (when ‘__unsuppflags == 0’)...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:4332:9: branch_false: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:4332:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:4335:19: branch_false: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:4337:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:4341:10: branch_false: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:4350:8: branch_false: following ‘false’ branch (when ‘snaps’ is non-NULL)...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:4353:8: branch_false: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:4353:8: branch_false: following ‘false’ branch (when ‘count <= 0’)...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:4368:5: branch_false: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:4368:5: release_memory: ‘snapshotsRet’ is NULL
libvirt-12.5.0/src/hyperv/hyperv_driver.c:4372:8: branch_true: following ‘true’ branch (when ‘ret < 0’)...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:4372:8: branch_true: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:4374:21: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/hyperv/hyperv_driver.c:4375:29: branch_true: ...to here
libvirt-12.5.0/src/hyperv/hyperv_driver.c:4375:17: danger: dereference of NULL ‘snapshotsRet + i * 8’
# 4373|           size_t i;
# 4374|           for (i = 0; i < count; i++) {
# 4375|->             if (snapshotsRet[i])
# 4376|                   virObjectUnref(snapshotsRet[i]);
# 4377|           }

Error: GCC_ANALYZER_WARNING (CWE-465): [#def93]
libvirt-12.5.0/src/hyperv/hyperv_wmi.c:1132:12: warning[-Wanalyzer-deref-before-check]: check of ‘object’ for NULL after already dereferencing it
# 1130|       serializerContext = wsmc_get_serialization_context(((hypervObject *)object)->priv->client);
# 1131|   
# 1132|->     while (object != NULL) {
# 1133|           next = ((hypervObject *)object)->next;
# 1134|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def94]
libvirt-12.5.0/src/libxl/libxl_driver.c:6291:46: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘iface’
libvirt-12.5.0/src/libxl/libxl_driver.c:6250:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/libxl/libxl_driver.c:6250:8: branch_false: ...to here
libvirt-12.5.0/src/libxl/libxl_driver.c:6253:17: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/libxl/libxl_driver.c:6256:33: branch_true: ...to here
libvirt-12.5.0/src/libxl/libxl_driver.c:6268:12: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/libxl/libxl_driver.c:6271:25: branch_false: ...to here
libvirt-12.5.0/src/libxl/libxl_driver.c:6271:12: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/libxl/libxl_driver.c:6275:12: branch_false: ...to here
libvirt-12.5.0/src/libxl/libxl_driver.c:6275:12: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/libxl/libxl_driver.c:6289:9: branch_false: ...to here
libvirt-12.5.0/src/libxl/libxl_driver.c:6289:21: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/libxl/libxl_driver.c:6290:50: branch_true: ...to here
libvirt-12.5.0/src/libxl/libxl_driver.c:6291:46: danger: dereference of NULL ‘iface’
# 6289|           for (j = 0; j < n_leases; j++) {
# 6290|               virNetworkDHCPLeasePtr lease = leases[j];
# 6291|->             virDomainIPAddressPtr ip_addr = &iface->addrs[j];
# 6292|   
# 6293|               ip_addr->addr = g_strdup(lease->ipaddr);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def95]
libvirt-12.5.0/src/libxl/libxl_logger.c:198:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(g_strdup_printf("%s/%s.log", *logger.logDir,  name), "a")’
libvirt-12.5.0/src/libxl/libxl_logger.c:181:1: enter_function: entry to ‘libxlLoggerOpenFile’
libvirt-12.5.0/src/libxl/libxl_logger.c:193:21: acquire_resource: opened here
libvirt-12.5.0/src/libxl/libxl_logger.c:193:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/libxl/libxl_logger.c:198:5: branch_false: ...to here
libvirt-12.5.0/src/libxl/libxl_logger.c:198:5: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/libxl/libxl_logger.c:198:5: call_function: inlined call to ‘glib_auto_cleanup_virLockGuard’ from ‘libxlLoggerOpenFile’
libvirt-12.5.0/src/libxl/libxl_logger.c:198:5: danger: ‘fopen(g_strdup_printf("%s/%s.log", *logger.logDir,  name), "a")’ leaks here; was opened at [(2)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/1)
#  196|           return;
#  197|       }
#  198|->     VIR_WITH_MUTEX_LOCK_GUARD(&logger->tableLock) {
#  199|           ignore_value(virHashAddEntry(logger->files, domidstr, logFile));
#  200|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def96]
libvirt-12.5.0/src/libxl/libxl_logger.c:198:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(g_strdup_printf("%s/%s.log", *logger.logDir,  name), "a")’
libvirt-12.5.0/src/libxl/libxl_logger.c:181:1: enter_function: entry to ‘libxlLoggerOpenFile’
libvirt-12.5.0/src/libxl/libxl_logger.c:193:21: acquire_memory: allocated here
libvirt-12.5.0/src/libxl/libxl_logger.c:193:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/libxl/libxl_logger.c:198:5: branch_false: ...to here
libvirt-12.5.0/src/libxl/libxl_logger.c:198:5: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/libxl/libxl_logger.c:198:5: call_function: inlined call to ‘glib_auto_cleanup_virLockGuard’ from ‘libxlLoggerOpenFile’
libvirt-12.5.0/src/libxl/libxl_logger.c:198:5: danger: ‘fopen(g_strdup_printf("%s/%s.log", *logger.logDir,  name), "a")’ leaks here; was allocated at [(2)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/1)
#  196|           return;
#  197|       }
#  198|->     VIR_WITH_MUTEX_LOCK_GUARD(&logger->tableLock) {
#  199|           ignore_value(virHashAddEntry(logger->files, domidstr, logFile));
#  200|       }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def97]
libvirt-12.5.0/src/libxl/xen_xl.c:997:17: warning[-Wanalyzer-null-argument]: use of NULL ‘type’ where non-null expected
libvirt-12.5.0/src/libxl/xen_xl.c:955:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/libxl/xen_xl.c:957:16: branch_true: following ‘true’ branch (when ‘list’ is non-NULL)...
libvirt-12.5.0/src/libxl/xen_xl.c:963:18: branch_true: ...to here
libvirt-12.5.0/src/libxl/xen_xl.c:967:20: branch_true: following ‘true’ branch (when ‘key’ is non-NULL)...
libvirt-12.5.0/src/libxl/xen_xl.c:969:33: branch_true: ...to here
libvirt-12.5.0/src/libxl/xen_xl.c:975:20: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/libxl/xen_xl.c:979:27: branch_false: ...to here
libvirt-12.5.0/src/libxl/xen_xl.c:979:27: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/libxl/xen_xl.c:980:25: branch_false: following ‘false’ branch (when ‘nextkey’ is NULL)...
libvirt-12.5.0/src/libxl/xen_xl.c:980:60: branch_false: ...to here
libvirt-12.5.0/src/libxl/xen_xl.c:987:24: branch_false: following ‘false’ branch (when ‘nextkey’ is NULL)...
libvirt-12.5.0/src/libxl/xen_xl.c:987:24: branch_false: ...to here
libvirt-12.5.0/src/libxl/xen_xl.c:967:20: branch_false: following ‘false’ branch (when ‘key’ is NULL)...
libvirt-12.5.0/src/libxl/xen_xl.c:994:29: branch_false: ...to here
libvirt-12.5.0/src/libxl/xen_xl.c:994:16: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/libxl/xen_xl.c:997:17: branch_false: ...to here
libvirt-12.5.0/src/libxl/xen_xl.c:997:17: danger: argument 1 (‘type’) NULL where non-null expected
#  995|                   goto cleanup;
#  996|   
#  997|->             if (STRPREFIX(type, "socket")) {
#  998|                   channel->source->type = VIR_DOMAIN_CHR_TYPE_UNIX;
#  999|                   channel->source->data.nix.listen = 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def98]
libvirt-12.5.0/src/lxc/lxc_container.c:1906:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
libvirt-12.5.0/src/lxc/lxc_container.c:1895:12: enter_function: entry to ‘lxcContainerSetHostname’
libvirt-12.5.0/src/lxc/lxc_container.c:1906:9: danger: dereference of NULL ‘<unknown>’
# 1904|       virStringFilterChars(name, hostname_validchars);
# 1905|       hostname = name;
# 1906|->     if (strlen(name) > 0 && name[0] == '-')
# 1907|           hostname = name + 1;
# 1908|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def99]
libvirt-12.5.0/src/lxc/lxc_driver.c:2981:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dev’
libvirt-12.5.0/src/lxc/lxc_driver.c:4389:12: enter_function: entry to ‘lxcDomainAttachDeviceFlags’
libvirt-12.5.0/src/lxc/lxc_driver.c:4401:5: branch_false: following ‘false’ branch (when ‘__unsuppflags == 0’)...
libvirt-12.5.0/src/lxc/lxc_driver.c:4404:16: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4404:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4407:9: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4407:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4410:9: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4410:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4413:9: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4413:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4416:9: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4416:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4423:9: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4423:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4424:26: branch_true: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4424:12: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4430:9: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4430:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4432:17: branch_true: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4433:12: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4436:13: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4436:12: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4441:20: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4441:20: call_function: calling ‘lxcDomainAttachDeviceConfig’ from ‘lxcDomainAttachDeviceFlags’
# 2979|       virDomainHostdevDef *hostdev;
# 2980|   
# 2981|->     switch (dev->type) {
# 2982|       case VIR_DOMAIN_DEVICE_DISK:
# 2983|           disk = dev->data.disk;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def100]
libvirt-12.5.0/src/lxc/lxc_driver.c:3125:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dev’
libvirt-12.5.0/src/lxc/lxc_driver.c:4549:12: enter_function: entry to ‘lxcDomainDetachDeviceFlags’
libvirt-12.5.0/src/lxc/lxc_driver.c:4564:5: branch_false: following ‘false’ branch (when ‘__unsuppflags == 0’)...
libvirt-12.5.0/src/lxc/lxc_driver.c:4567:16: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4567:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4570:9: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4570:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4573:9: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4573:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4576:9: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4576:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4579:18: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4579:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4582:9: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4582:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4588:9: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4588:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4589:26: branch_true: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4589:12: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4594:9: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4594:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4596:17: branch_true: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4597:12: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4600:20: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4600:20: call_function: calling ‘lxcDomainDetachDeviceConfig’ from ‘lxcDomainDetachDeviceFlags’
# 3123|       int idx;
# 3124|   
# 3125|->     switch (dev->type) {
# 3126|       case VIR_DOMAIN_DEVICE_DISK:
# 3127|           disk = dev->data.disk;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def101]
libvirt-12.5.0/src/lxc/lxc_driver.c:3915:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dev’
libvirt-12.5.0/src/lxc/lxc_driver.c:4389:12: enter_function: entry to ‘lxcDomainAttachDeviceFlags’
libvirt-12.5.0/src/lxc/lxc_driver.c:4401:5: branch_false: following ‘false’ branch (when ‘__unsuppflags == 0’)...
libvirt-12.5.0/src/lxc/lxc_driver.c:4404:16: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4404:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4407:9: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4407:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4410:9: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4410:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4413:9: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4413:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4416:9: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4416:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4417:28: branch_true: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4417:12: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4423:9: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4423:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4430:9: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4430:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4432:17: branch_true: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4433:12: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4436:13: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4436:12: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4441:20: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4441:12: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4445:9: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4445:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4446:44: branch_true: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4446:12: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4451:20: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4451:20: call_function: calling ‘lxcDomainAttachDeviceLive’ from ‘lxcDomainAttachDeviceFlags’
# 3913|       int ret = -1;
# 3914|   
# 3915|->     switch (dev->type) {
# 3916|       case VIR_DOMAIN_DEVICE_DISK:
# 3917|           ret = lxcDomainAttachDeviceDiskLive(driver, vm, dev);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def102]
libvirt-12.5.0/src/lxc/lxc_driver.c:4340:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dev’
libvirt-12.5.0/src/lxc/lxc_driver.c:4549:12: enter_function: entry to ‘lxcDomainDetachDeviceFlags’
libvirt-12.5.0/src/lxc/lxc_driver.c:4564:5: branch_false: following ‘false’ branch (when ‘__unsuppflags == 0’)...
libvirt-12.5.0/src/lxc/lxc_driver.c:4567:16: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4567:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4570:9: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4570:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4573:9: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4573:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4576:9: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4576:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4579:18: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4579:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4582:9: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4582:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4583:28: branch_true: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4583:12: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4588:9: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4588:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4594:9: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4594:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4596:17: branch_true: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4597:12: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4600:20: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4600:12: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4604:9: branch_false: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4604:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/lxc/lxc_driver.c:4605:20: branch_true: ...to here
libvirt-12.5.0/src/lxc/lxc_driver.c:4605:20: call_function: calling ‘lxcDomainDetachDeviceLive’ from ‘lxcDomainDetachDeviceFlags’
# 4338|       int ret = -1;
# 4339|   
# 4340|->     switch (dev->type) {
# 4341|       case VIR_DOMAIN_DEVICE_DISK:
# 4342|           ret = lxcDomainDetachDeviceDiskLive(vm, dev);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def103]
libvirt-12.5.0/src/node_device/node_device_driver.c:1919:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘defs’
libvirt-12.5.0/src/node_device/node_device_driver.c:1891:1: enter_function: entry to ‘nodeDeviceUpdateMediatedDevices’
libvirt-12.5.0/src/node_device/node_device_driver.c:1893:35: release_memory: ‘defs’ is NULL
libvirt-12.5.0/src/node_device/node_device_driver.c:1894:35: release_memory: ‘defs’ is NULL
libvirt-12.5.0/src/node_device/node_device_driver.c:1901:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/node_device/node_device_driver.c:1906:23: branch_false: ...to here
libvirt-12.5.0/src/node_device/node_device_driver.c:1906:23: call_function: calling ‘virMdevctlList’ from ‘nodeDeviceUpdateMediatedDevices’
libvirt-12.5.0/src/node_device/node_device_driver.c:1906:23: return_function: returning to ‘nodeDeviceUpdateMediatedDevices’ from ‘virMdevctlList’
libvirt-12.5.0/src/node_device/node_device_driver.c:1906:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/node_device/node_device_driver.c:1914:5: branch_false: ...to here
libvirt-12.5.0/src/node_device/node_device_driver.c:1914:5: release_memory: ‘defs’ is NULL
libvirt-12.5.0/src/node_device/node_device_driver.c:1918:17: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/node_device/node_device_driver.c:1919:48: branch_true: ...to here
libvirt-12.5.0/src/node_device/node_device_driver.c:1919:48: release_memory: ‘defs’ is NULL
libvirt-12.5.0/src/node_device/node_device_driver.c:1919:13: danger: dereference of NULL ‘defs + i * 8’
# 1917|   
# 1918|       for (i = 0; i < data.ndefs; i++)
# 1919|->         if (nodeDeviceUpdateMediatedDevice(defs[i], true) < 0)
# 1920|               return -1;
# 1921|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def104]
libvirt-12.5.0/src/qemu/qemu_alias.c:43:10: warning[-Wanalyzer-null-argument]: use of NULL ‘prefix’ where non-null expected
libvirt-12.5.0/src/qemu/qemu_alias.c:84:1: enter_function: entry to ‘qemuAssignDeviceChrAlias’
libvirt-12.5.0/src/qemu/qemu_alias.c:127:8: branch_true: following ‘true’ branch (when ‘idx == -1’)...
libvirt-12.5.0/src/qemu/qemu_alias.c:127:29: branch_true: ...to here
libvirt-12.5.0/src/qemu/qemu_alias.c:127:29: call_function: calling ‘qemuGetNextChrDevIndex’ from ‘qemuAssignDeviceChrAlias’
#   41|       if (!info->alias)
#   42|           return -1;
#   43|->     if (!STRPREFIX(info->alias, prefix))
#   44|           return -1;
#   45|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def105]
libvirt-12.5.0/src/qemu/qemu_blockjob.c:1087:5: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘baseparent’
libvirt-12.5.0/src/qemu/qemu_blockjob.c:1650:1: enter_function: entry to ‘qemuBlockJobUpdate’
libvirt-12.5.0/src/qemu/qemu_blockjob.c:1656:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/qemu/qemu_blockjob.c:1659:5: branch_false: ...to here
libvirt-12.5.0/src/qemu/qemu_blockjob.c:1659:5: call_function: calling ‘qemuBlockJobEventProcess’ from ‘qemuBlockJobUpdate’
# 1085|   
# 1086|   
# 1087|->     baseparent->backingStore = NULL;
# 1088|       job->data.commit.topparent->backingStore = job->data.commit.base;
# 1089|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def106]
libvirt-12.5.0/src/qemu/qemu_blockjob.c:1177:5: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘baseparent’
libvirt-12.5.0/src/qemu/qemu_blockjob.c:1650:1: enter_function: entry to ‘qemuBlockJobUpdate’
libvirt-12.5.0/src/qemu/qemu_blockjob.c:1656:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/qemu/qemu_blockjob.c:1659:5: branch_false: ...to here
libvirt-12.5.0/src/qemu/qemu_blockjob.c:1659:5: call_function: calling ‘qemuBlockJobEventProcess’ from ‘qemuBlockJobUpdate’
# 1175|           VIR_WARN("Unable to move disk metadata on vm %s", vm->def->name);
# 1176|   
# 1177|->     baseparent->backingStore = NULL;
# 1178|       job->disk->src = job->data.commit.base;
# 1179|       job->disk->src->readonly = job->data.commit.top->readonly;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def107]
libvirt-12.5.0/src/qemu/qemu_capabilities.c:6145:9: warning[-Wanalyzer-null-argument]: use of NULL ‘binary’ where non-null expected
libvirt-12.5.0/src/qemu/qemu_capabilities.c:6208:1: enter_function: entry to ‘virQEMUCapsNewData’
libvirt-12.5.0/src/qemu/qemu_capabilities.c:6213:12: call_function: calling ‘virQEMUCapsNewForBinaryInternal’ from ‘virQEMUCapsNewData’
# 6143|       /* We would also want to check faccessat if we cared about ACLs,
# 6144|        * but we don't.  */
# 6145|->     if (stat(binary, &sb) < 0) {
# 6146|           virReportSystemError(errno, _("Cannot check QEMU binary %1$s"),
# 6147|                                binary);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def108]
libvirt-12.5.0/src/qemu/qemu_driver.c:4564:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘vcpuinfo’
libvirt-12.5.0/src/qemu/qemu_driver.c:4525:5: branch_false: following ‘false’ branch (when ‘__unsuppflags == 0’)...
libvirt-12.5.0/src/qemu/qemu_driver.c:4528:11: branch_false: ...to here
libvirt-12.5.0/src/qemu/qemu_driver.c:4530:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/qemu/qemu_driver.c:4533:9: branch_false: ...to here
libvirt-12.5.0/src/qemu/qemu_driver.c:4533:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/qemu/qemu_driver.c:4536:9: branch_false: ...to here
libvirt-12.5.0/src/qemu/qemu_driver.c:4536:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/qemu/qemu_driver.c:4539:9: branch_false: ...to here
libvirt-12.5.0/src/qemu/qemu_driver.c:4539:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/qemu/qemu_driver.c:4542:9: branch_false: ...to here
libvirt-12.5.0/src/qemu/qemu_driver.c:4542:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/qemu/qemu_driver.c:4550:21: branch_false: ...to here
libvirt-12.5.0/src/qemu/qemu_driver.c:4550:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/qemu/qemu_driver.c:4553:9: branch_false: ...to here
libvirt-12.5.0/src/qemu/qemu_driver.c:4553:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/qemu/qemu_driver.c:4559:9: branch_false: ...to here
libvirt-12.5.0/src/qemu/qemu_driver.c:4563:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/qemu/qemu_driver.c:4564:9: branch_true: ...to here
libvirt-12.5.0/src/qemu/qemu_driver.c:4564:9: danger: dereference of NULL ‘vcpuinfo’
# 4562|   
# 4563|       if (persistentDef) {
# 4564|->         virBitmapFree(vcpuinfo->cpumask);
# 4565|           vcpuinfo->cpumask = g_steal_pointer(&pcpumap);
# 4566|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def109]
libvirt-12.5.0/src/qemu/qemu_driver.c:7325:43: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dev’
libvirt-12.5.0/src/qemu/qemu_driver.c:7615:1: enter_function: entry to ‘qemuDomainUpdateDeviceFlags’
libvirt-12.5.0/src/qemu/qemu_driver.c:7631:5: branch_false: following ‘false’ branch (when ‘__unsuppflags == 0’)...
libvirt-12.5.0/src/qemu/qemu_driver.c:7635:11: branch_false: ...to here
libvirt-12.5.0/src/qemu/qemu_driver.c:7637:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/qemu/qemu_driver.c:7640:5: branch_false: ...to here
libvirt-12.5.0/src/qemu/qemu_driver.c:7642:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/qemu/qemu_driver.c:7645:9: branch_false: ...to here
libvirt-12.5.0/src/qemu/qemu_driver.c:7645:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/qemu/qemu_driver.c:7648:9: branch_false: ...to here
libvirt-12.5.0/src/qemu/qemu_driver.c:7648:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/qemu/qemu_driver.c:7651:9: branch_false: ...to here
libvirt-12.5.0/src/qemu/qemu_driver.c:7655:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/qemu/qemu_driver.c:7661:9: branch_false: ...to here
libvirt-12.5.0/src/qemu/qemu_driver.c:7661:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/qemu/qemu_driver.c:7663:50: branch_true: ...to here
libvirt-12.5.0/src/qemu/qemu_driver.c:7662:12: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/qemu/qemu_driver.c:7667:9: branch_false: ...to here
libvirt-12.5.0/src/qemu/qemu_driver.c:7667:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/qemu/qemu_driver.c:7670:47: branch_true: ...to here
libvirt-12.5.0/src/qemu/qemu_driver.c:7671:12: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/qemu/qemu_driver.c:7676:20: branch_false: ...to here
libvirt-12.5.0/src/qemu/qemu_driver.c:7676:20: call_function: calling ‘qemuDomainUpdateDeviceConfig’ from ‘qemuDomainUpdateDeviceFlags’
# 7323|       virDomainNetDef *net;
# 7324|       virDomainMemoryDef *mem;
# 7325|->     virDomainDeviceDef oldDev = { .type = dev->type };
# 7326|       int pos;
# 7327|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def110]
libvirt-12.5.0/src/qemu/qemu_namespace.c:1217:9: warning[-Wanalyzer-null-argument]: use of NULL ‘file’ where non-null expected
libvirt-12.5.0/src/qemu/qemu_namespace.c:1746:1: enter_function: entry to ‘qemuDomainNamespaceSetupInput’
libvirt-12.5.0/src/qemu/qemu_namespace.c:1753:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/qemu/qemu_namespace.c:1756:9: branch_true: ...to here
libvirt-12.5.0/src/qemu/qemu_namespace.c:1756:9: call_function: calling ‘qemuDomainSetupInput’ from ‘qemuDomainNamespaceSetupInput’
libvirt-12.5.0/src/qemu/qemu_namespace.c:1756:9: return_function: returning to ‘qemuDomainNamespaceSetupInput’ from ‘qemuDomainSetupInput’
libvirt-12.5.0/src/qemu/qemu_namespace.c:1759:16: call_function: calling ‘qemuNamespaceMknodPaths’ from ‘qemuDomainNamespaceSetupInput’
# 1215|       item->file = g_strdup(file);
# 1216|   
# 1217|->     if (g_lstat(file, &item->sb) < 0) {
# 1218|           if (errno == ENOENT)
# 1219|               return -2;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def111]
libvirt-12.5.0/src/qemu/qemu_namespace.c:1475:41: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mount’
libvirt-12.5.0/src/qemu/qemu_namespace.c:1767:1: enter_function: entry to ‘qemuDomainNamespaceTeardownInput’
libvirt-12.5.0/src/qemu/qemu_namespace.c:1772:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/qemu/qemu_namespace.c:1775:9: branch_true: ...to here
libvirt-12.5.0/src/qemu/qemu_namespace.c:1775:9: call_function: calling ‘qemuDomainSetupInput’ from ‘qemuDomainNamespaceTeardownInput’
libvirt-12.5.0/src/qemu/qemu_namespace.c:1775:9: return_function: returning to ‘qemuDomainNamespaceTeardownInput’ from ‘qemuDomainSetupInput’
libvirt-12.5.0/src/qemu/qemu_namespace.c:1778:9: call_function: calling ‘qemuNamespaceUnlinkPaths’ from ‘qemuDomainNamespaceTeardownInput’
# 1473|               const char *const *devices = (const char *const *)cfg->cgroupDeviceACL;
# 1474|   
# 1475|->             for (mount = devMountsPath; *mount; mount++) {
# 1476|                   if (STREQ(*mount, "/dev"))
# 1477|                       continue;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def112]
libvirt-12.5.0/src/qemu/qemu_nbdkit.c:252:9: warning[-Wanalyzer-null-argument]: use of NULL ‘*caps.path’ where non-null expected
libvirt-12.5.0/src/qemu/qemu_nbdkit.c:354:1: enter_function: entry to ‘virNbdkitCapsNewData’
libvirt-12.5.0/src/qemu/qemu_nbdkit.c:365:12: call_function: calling ‘qemuNbdkitCapsNew’ from ‘virNbdkitCapsNewData’
libvirt-12.5.0/src/qemu/qemu_nbdkit.c:365:12: return_function: returning to ‘virNbdkitCapsNewData’ from ‘qemuNbdkitCapsNew’
libvirt-12.5.0/src/qemu/qemu_nbdkit.c:366:5: call_function: calling ‘qemuNbdkitCapsQuery’ from ‘virNbdkitCapsNewData’
#  250|       struct stat st;
#  251|   
#  252|->     if (stat(caps->path, &st) < 0) {
#  253|           VIR_DEBUG("Failed to stat nbdkit binary '%s': %s",
#  254|                     caps->path,

Error: GCC_ANALYZER_WARNING (CWE-688): [#def113]
libvirt-12.5.0/src/qemu/qemu_nbdkit.c:1264:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘nbd_create()’ where non-null expected
libvirt-12.5.0/src/qemu/qemu_nbdkit.c:1175:1: enter_function: entry to ‘qemuNbdkitProcessStart’
libvirt-12.5.0/src/qemu/qemu_nbdkit.c:1195:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/qemu/qemu_nbdkit.c:1201:17: branch_false: ...to here
libvirt-12.5.0/src/qemu/qemu_nbdkit.c:1201:17: call_function: calling ‘qemuNbdkitProcessBuildCommand’ from ‘qemuNbdkitProcessStart’
libvirt-12.5.0/src/qemu/qemu_nbdkit.c:1201:17: return_function: returning to ‘qemuNbdkitProcessStart’ from ‘qemuNbdkitProcessBuildCommand’
libvirt-12.5.0/src/qemu/qemu_nbdkit.c:1201:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/qemu/qemu_nbdkit.c:1204:24: branch_false: ...to here
libvirt-12.5.0/src/qemu/qemu_nbdkit.c:1204:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/qemu/qemu_nbdkit.c:1212:13: branch_false: ...to here
libvirt-12.5.0/src/qemu/qemu_nbdkit.c:1219:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/qemu/qemu_nbdkit.c:1222:9: branch_false: ...to here
libvirt-12.5.0/src/qemu/qemu_nbdkit.c:1234:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/qemu/qemu_nbdkit.c:1237:9: branch_false: ...to here
libvirt-12.5.0/src/qemu/qemu_nbdkit.c:1237:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/qemu/qemu_nbdkit.c:1243:15: branch_false: ...to here
libvirt-12.5.0/src/qemu/qemu_nbdkit.c:1243:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/qemu/qemu_nbdkit.c:1250:9: branch_false: ...to here
libvirt-12.5.0/src/qemu/qemu_nbdkit.c:1250:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/qemu/qemu_nbdkit.c:1250:8: branch_false: ...to here
libvirt-12.5.0/src/qemu/qemu_nbdkit.c:1253:12: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/qemu/qemu_nbdkit.c:1254:27: branch_true: ...to here
libvirt-12.5.0/src/qemu/qemu_nbdkit.c:1263:19: acquire_memory: this call could return NULL
libvirt-12.5.0/src/qemu/qemu_nbdkit.c:1264:17: danger: argument 1 (‘nbd_create()’) from [(25)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/24) could be NULL where non-null expected
# 1262|                */
# 1263|               nbd = nbd_create();
# 1264|->             if (nbd_connect_unix(nbd, proc->socketfile) < 0) {
# 1265|                   VIR_WARN("nbd_connect_unix failed: %s", nbd_get_error());
# 1266|                   nbd_close(nbd);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def114]
libvirt-12.5.0/src/qemu/qemu_snapshot.c:2529:16: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘tmpsnapdef’
libvirt-12.5.0/src/qemu/qemu_snapshot.c:2922:1: enter_function: entry to ‘qemuSnapshotRevert’
libvirt-12.5.0/src/qemu/qemu_snapshot.c:2951:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/qemu/qemu_snapshot.c:2957:9: branch_false: ...to here
libvirt-12.5.0/src/qemu/qemu_snapshot.c:2957:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/qemu/qemu_snapshot.c:2963:18: branch_false: ...to here
libvirt-12.5.0/src/qemu/qemu_snapshot.c:2963:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/qemu/qemu_snapshot.c:2965:15: call_function: inlined call to ‘virDomainSnapshotObjGetDef’ from ‘qemuSnapshotRevert’
libvirt-12.5.0/src/qemu/qemu_snapshot.c:2967:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/qemu/qemu_snapshot.c:2970:9: branch_false: ...to here
libvirt-12.5.0/src/qemu/qemu_snapshot.c:2970:9: call_function: calling ‘qemuSnapshotRevertPrep’ from ‘qemuSnapshotRevert’
libvirt-12.5.0/src/qemu/qemu_snapshot.c:2970:9: return_function: returning to ‘qemuSnapshotRevert’ from ‘qemuSnapshotRevertPrep’
libvirt-12.5.0/src/qemu/qemu_snapshot.c:2970:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/qemu/qemu_snapshot.c:2975:38: branch_false: ...to here
libvirt-12.5.0/src/qemu/qemu_snapshot.c:2978:15: call_function: calling ‘qemuSnapshotRevertActive’ from ‘qemuSnapshotRevert’
# 2527|       g_autoptr(qemuSnapshotDiskContext) snapctxt = NULL;
# 2528|   
# 2529|->     snapctxt = qemuSnapshotDiskContextNew(tmpsnapdef->ndisks, vm, VIR_ASYNC_JOB_SNAPSHOT);
# 2530|   
# 2531|       if (!(blockNamedNodeData = qemuBlockGetNamedNodeData(vm, VIR_ASYNC_JOB_SNAPSHOT)))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def115]
libvirt-12.5.0/src/qemu/qemu_vhost_user.c:330:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘vu’
libvirt-12.5.0/src/qemu/qemu_vhost_user.c:340:1: enter_function: entry to ‘qemuVhostUserFillDomainGPU’
libvirt-12.5.0/src/qemu/qemu_vhost_user.c:349:17: call_function: calling ‘qemuVhostUserFetchParsedConfigs’ from ‘qemuVhostUserFillDomainGPU’
libvirt-12.5.0/src/qemu/qemu_vhost_user.c:349:17: return_function: returning to ‘qemuVhostUserFillDomainGPU’ from ‘qemuVhostUserFetchParsedConfigs’
libvirt-12.5.0/src/qemu/qemu_vhost_user.c:349:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/qemu/qemu_vhost_user.c:349:8: branch_false: ...to here
libvirt-12.5.0/src/qemu/qemu_vhost_user.c:353:17: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/qemu/qemu_vhost_user.c:398:8: branch_false: ...to here
libvirt-12.5.0/src/qemu/qemu_vhost_user.c:398:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/qemu/qemu_vhost_user.c:404:10: branch_false: ...to here
libvirt-12.5.0/src/qemu/qemu_vhost_user.c:404:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/qemu/qemu_vhost_user.c:407:10: branch_false: ...to here
libvirt-12.5.0/src/qemu/qemu_vhost_user.c:407:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/qemu/qemu_vhost_user.c:407:8: branch_true: ...to here
libvirt-12.5.0/src/qemu/qemu_vhost_user.c:408:9: call_function: inlined call to ‘qemuVhostUserGPUHasFeature’ from ‘qemuVhostUserFillDomainGPU’
#  328|       size_t i;
#  329|   
#  330|->     for (i = 0; i < gpu->nfeatures; i++) {
#  331|           if (gpu->features[i] == feature)
#  332|               return true;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def116]
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:3457:43: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:3421:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:3424:5: branch_false: ...to here
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:3426:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:3430:8: branch_false: ...to here
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:3430:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:3434:8: branch_false: ...to here
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:3434:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:3436:15: branch_false: ...to here
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:3438:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:3444:9: branch_false: ...to here
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:3444:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:3450:5: branch_false: ...to here
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:3453:17: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:3455:43: branch_true: ...to here
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:3457:43: danger: dereference of NULL ‘params + i * 88’
# 3455|           ret->params.params_val[i].field = g_strdup(params[i].field);
# 3456|   
# 3457|->         ret->params.params_val[i].value = params[i].value;
# 3458|       }
# 3459|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def117]
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:3523:43: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:3487:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:3490:5: branch_false: ...to here
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:3492:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:3496:8: branch_false: ...to here
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:3496:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:3500:8: branch_false: ...to here
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:3500:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:3502:15: branch_false: ...to here
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:3504:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:3510:9: branch_false: ...to here
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:3510:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:3516:5: branch_false: ...to here
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:3519:17: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:3521:43: branch_true: ...to here
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:3523:43: danger: dereference of NULL ‘params + i * 88’
# 3521|           ret->params.params_val[i].field = g_strdup(params[i].field);
# 3522|   
# 3523|->         ret->params.params_val[i].value = params[i].value;
# 3524|       }
# 3525|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def118]
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:5341:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:5300:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:5303:9: branch_false: ...to here
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:5303:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:5307:9: branch_false: ...to here
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:5307:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:5312:8: branch_false: ...to here
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:5312:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:5312:8: branch_false: ...to here
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:5315:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:5320:39: branch_false: ...to here
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:5321:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:5324:9: branch_false: ...to here
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:5337:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:5340:21: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:5341:23: branch_true: ...to here
libvirt-12.5.0/src/remote/remote_daemon_dispatch.c:5341:17: danger: dereference of NULL ‘params + i * 96’
# 5339|   
# 5340|           for (i = 0; i < percpu_len; i++) {
# 5341|->             if (params[i].type == VIR_TYPED_PARAM_STRING)
# 5342|                   ret->nparams--;
# 5343|           }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def119]
libvirt-12.5.0/src/remote/remote_driver.c:3570:10: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘state’
libvirt-12.5.0/src/remote/remote_driver.c:3635:12: enter_function: entry to ‘remoteAuthInteract’
libvirt-12.5.0/src/remote/remote_driver.c:3640:5: call_function: inlined call to ‘remoteAuthInteractStateClear’ from ‘remoteAuthInteract’
libvirt-12.5.0/src/remote/remote_driver.c:3643:9: branch_true: ...to here
libvirt-12.5.0/src/remote/remote_driver.c:3643:9: call_function: calling ‘remoteAuthFillFromConfig’ from ‘remoteAuthInteract’
# 3568|       VIR_DEBUG("Trying to fill auth parameters from config file");
# 3569|   
# 3570|->     if (!state->config) {
# 3571|           if (virAuthGetConfigFilePath(conn, &path) < 0)
# 3572|               return -1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def120]
libvirt-12.5.0/src/remote/remote_driver.c:6998:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘leases_ret’
libvirt-12.5.0/src/remote/remote_driver.c:6963:1: enter_function: entry to ‘remoteNetworkGetDHCPLeases’
libvirt-12.5.0/src/remote/remote_driver.c:6977:16: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/remote/remote_driver.c:6977:5: branch_true: ...to here
libvirt-12.5.0/src/remote/remote_driver.c:6981:9: call_function: calling ‘call’ from ‘remoteNetworkGetDHCPLeases’
libvirt-12.5.0/src/remote/remote_driver.c:6981:9: return_function: returning to ‘remoteNetworkGetDHCPLeases’ from ‘call’
libvirt-12.5.0/src/remote/remote_driver.c:6981:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/remote/remote_driver.c:6986:9: branch_false: ...to here
libvirt-12.5.0/src/remote/remote_driver.c:6986:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/remote/remote_driver.c:6993:8: branch_false: ...to here
libvirt-12.5.0/src/remote/remote_driver.c:6993:8: branch_true: following ‘true’ branch (when ‘leases’ is non-NULL)...
libvirt-12.5.0/src/remote/remote_driver.c:6994:12: branch_true: ...to here
libvirt-12.5.0/src/remote/remote_driver.c:6994:12: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/remote/remote_driver.c:6997:9: branch_false: ...to here
libvirt-12.5.0/src/remote/remote_driver.c:6997:21: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/remote/remote_driver.c:6998:29: branch_true: ...to here
libvirt-12.5.0/src/remote/remote_driver.c:6998:13: danger: dereference of NULL ‘leases_ret + i * 8’
# 6996|   
# 6997|           for (i = 0; i < ret.leases.leases_len; i++) {
# 6998|->             leases_ret[i] = g_new0(virNetworkDHCPLease, 1);
# 6999|   
# 7000|               if (remoteSerializeDHCPLease(leases_ret[i], &ret.leases.leases_val[i]) < 0)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def121]
libvirt-12.5.0/src/remote/remote_driver.c:7241:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ifaces_ret’
libvirt-12.5.0/src/remote/remote_driver.c:7202:1: enter_function: entry to ‘remoteDomainInterfaceAddresses’
libvirt-12.5.0/src/remote/remote_driver.c:7220:9: call_function: calling ‘call’ from ‘remoteDomainInterfaceAddresses’
libvirt-12.5.0/src/remote/remote_driver.c:7220:9: return_function: returning to ‘remoteDomainInterfaceAddresses’ from ‘call’
libvirt-12.5.0/src/remote/remote_driver.c:7220:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/remote/remote_driver.c:7227:9: branch_false: ...to here
libvirt-12.5.0/src/remote/remote_driver.c:7227:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/remote/remote_driver.c:7234:8: branch_false: ...to here
libvirt-12.5.0/src/remote/remote_driver.c:7234:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/remote/remote_driver.c:7237:5: branch_false: ...to here
libvirt-12.5.0/src/remote/remote_driver.c:7237:17: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/remote/remote_driver.c:7239:48: branch_true: ...to here
libvirt-12.5.0/src/remote/remote_driver.c:7241:9: danger: dereference of NULL ‘ifaces_ret + i * 8’
# 7239|           remote_domain_interface *iface_ret = &(ret.ifaces.ifaces_val[i]);
# 7240|   
# 7241|->         ifaces_ret[i] = g_new0(virDomainInterface, 1);
# 7242|   
# 7243|           iface = ifaces_ret[i];

Error: GCC_ANALYZER_WARNING (CWE-126): [#def122]
libvirt-12.5.0/src/rpc/virnetserverservice.c:145:25: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libvirt-12.5.0/src/rpc/virnetserverservice.c:228:22: enter_function: entry to ‘virNetServerServiceNewUNIX’
libvirt-12.5.0/src/rpc/virnetserverservice.c:242:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/rpc/virnetserverservice.c:249:11: branch_false: ...to here
libvirt-12.5.0/src/rpc/virnetserverservice.c:249:11: call_function: calling ‘virNetServerServiceNewSocket’ from ‘virNetServerServiceNewUNIX’
#  143|       svc->nsocks = nsocks;
#  144|       for (i = 0; i < svc->nsocks; i++) {
#  145|->         svc->socks[i] = socks[i];
#  146|           virObjectRef(svc->socks[i]);
#  147|       }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def123]
libvirt-12.5.0/src/rpc/virnetsocket.c:754:9: warning[-Wanalyzer-null-argument]: use of NULL ‘lockpath’ where non-null expected
libvirt-12.5.0/src/rpc/virnetsocket.c:659:5: enter_function: entry to ‘virNetSocketNewConnectUNIX’
libvirt-12.5.0/src/rpc/virnetsocket.c:677:8: branch_false: following ‘false’ branch (when ‘spawnDaemonPath’ is NULL)...
libvirt-12.5.0/src/rpc/virnetsocket.c:702:15: branch_false: ...to here
libvirt-12.5.0/src/rpc/virnetsocket.c:702:8: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
libvirt-12.5.0/src/rpc/virnetsocket.c:707:5: branch_false: ...to here
libvirt-12.5.0/src/rpc/virnetsocket.c:708:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/rpc/virnetsocket.c:712:9: branch_false: ...to here
libvirt-12.5.0/src/rpc/virnetsocket.c:747:22: call_function: calling ‘virNetSocketNew’ from ‘virNetSocketNewConnectUNIX’
libvirt-12.5.0/src/rpc/virnetsocket.c:747:22: return_function: returning to ‘virNetSocketNewConnectUNIX’ from ‘virNetSocketNew’
libvirt-12.5.0/src/rpc/virnetsocket.c:747:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/rpc/virnetsocket.c:752:2: branch_false: ...to here
libvirt-12.5.0/src/rpc/virnetsocket.c:753:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/rpc/virnetsocket.c:754:9: branch_true: ...to here
libvirt-12.5.0/src/rpc/virnetsocket.c:754:9: danger: argument 1 (‘lockpath’) NULL where non-null expected
#  752|    cleanup:
#  753|       if (lockfd != -1) {
#  754|->         unlink(lockpath);
#  755|       }
#  756|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def124]
libvirt-12.5.0/src/rpc/virnetsocket.c:2035:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*sock.fd’
# 2033|   {
# 2034|       virObjectLock(sock);
# 2035|->     if (listen(sock->fd, backlog > 0 ? backlog : 30) < 0) {
# 2036|           virReportSystemError(errno, "%s", _("Unable to listen on socket"));
# 2037|           virObjectUnlock(sock);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def125]
libvirt-12.5.0/src/rpc/virnetsocket.c:2040:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*sock.fd’
libvirt-12.5.0/src/rpc/virnetsocket.c:2035:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/rpc/virnetsocket.c:2040:5: branch_false: ...to here
libvirt-12.5.0/src/rpc/virnetsocket.c:2040:5: danger: ‘*sock.fd’ leaks here
# 2038|           return -1;
# 2039|       }
# 2040|->     virObjectUnlock(sock);
# 2041|       return 0;
# 2042|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def126]
libvirt-12.5.0/src/rpc/virnettlscontext.c:132:37: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘keys’
libvirt-12.5.0/src/rpc/virnettlscontext.c:381:19: enter_function: entry to ‘virNetTLSContextNewClient’
libvirt-12.5.0/src/rpc/virnettlscontext.c:390:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/rpc/virnettlscontext.c:390:8: branch_false: ...to here
libvirt-12.5.0/src/rpc/virnettlscontext.c:396:12: call_function: calling ‘virNetTLSContextNew’ from ‘virNetTLSContextNewClient’
#  130|       }
#  131|   
#  132|->     for (i = 0; certs[i] != NULL && keys[i] != NULL; i++) {
#  133|           VIR_DEBUG("loading cert and key from %s and %s", certs[i], keys[i]);
#  134|           err = gnutls_certificate_set_x509_key_file(ctxt->x509cred,

Error: GCC_ANALYZER_WARNING (CWE-688): [#def127]
libvirt-12.5.0/src/storage/storage_backend_logical.c:431:13: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-12.5.0/src/storage/storage_backend_logical.c:416:1: enter_function: entry to ‘virStorageBackendLogicalFindPoolSourcesFunc’
libvirt-12.5.0/src/storage/storage_backend_logical.c:430:17: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/storage/storage_backend_logical.c:431:13: branch_true: ...to here
libvirt-12.5.0/src/storage/storage_backend_logical.c:431:13: danger: argument 2 (‘<unknown>’) NULL where non-null expected
#  429|       thisSource = NULL;
#  430|       for (i = 0; i < sourceList->nsources; i++) {
#  431|->         if (STREQ(sourceList->sources[i].name, vgname)) {
#  432|               thisSource = &sourceList->sources[i];
#  433|               break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def128]
libvirt-12.5.0/src/storage/storage_backend_logical.c:587:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘thisSource’
libvirt-12.5.0/src/storage/storage_backend_logical.c:557:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/storage/storage_backend_logical.c:557:8: branch_false: ...to here
libvirt-12.5.0/src/storage/storage_backend_logical.c:561:17: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/storage/storage_backend_logical.c:567:8: branch_false: ...to here
libvirt-12.5.0/src/storage/storage_backend_logical.c:567:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/storage/storage_backend_logical.c:578:9: branch_false: ...to here
libvirt-12.5.0/src/storage/storage_backend_logical.c:578:7: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/storage/storage_backend_logical.c:578:7: branch_false: ...to here
libvirt-12.5.0/src/storage/storage_backend_logical.c:586:17: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/storage/storage_backend_logical.c:586:17: branch_true: ...to here
libvirt-12.5.0/src/storage/storage_backend_logical.c:587:25: danger: dereference of NULL ‘thisSource’
#  585|        */
#  586|       for (i = 0; i < def->source.ndevice; i++) {
#  587|->         for (j = 0; j < thisSource->ndevice; j++) {
#  588|               if (STREQ(def->source.devices[i].path,
#  589|                         thisSource->devices[j].path))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def129]
libvirt-12.5.0/src/test/test_driver.c:10578:43: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dev’
libvirt-12.5.0/src/test/test_driver.c:10643:1: enter_function: entry to ‘testDomainUpdateDeviceFlags’
libvirt-12.5.0/src/test/test_driver.c:10658:5: branch_false: following ‘false’ branch (when ‘__unsuppflags == 0’)...
libvirt-12.5.0/src/test/test_driver.c:10661:16: branch_false: ...to here
libvirt-12.5.0/src/test/test_driver.c:10661:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/test/test_driver.c:10664:9: branch_false: ...to here
libvirt-12.5.0/src/test/test_driver.c:10664:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/test/test_driver.c:10667:9: branch_false: ...to here
libvirt-12.5.0/src/test/test_driver.c:10667:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/test/test_driver.c:10670:9: branch_false: ...to here
libvirt-12.5.0/src/test/test_driver.c:10675:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/test/test_driver.c:10678:9: branch_false: ...to here
libvirt-12.5.0/src/test/test_driver.c:10678:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/test/test_driver.c:10684:9: branch_false: ...to here
libvirt-12.5.0/src/test/test_driver.c:10684:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/test/test_driver.c:10691:9: branch_false: ...to here
libvirt-12.5.0/src/test/test_driver.c:10691:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/test/test_driver.c:10693:17: branch_true: ...to here
libvirt-12.5.0/src/test/test_driver.c:10694:12: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/test/test_driver.c:10699:20: branch_false: ...to here
libvirt-12.5.0/src/test/test_driver.c:10699:20: call_function: calling ‘testDomainUpdateDevice’ from ‘testDomainUpdateDeviceFlags’
#10576|   {
#10577|       virDomainDiskDef *newDisk;
#10578|->     virDomainDeviceDef oldDev = { .type = dev->type };
#10579|       int pos;
#10580|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def130]
libvirt-12.5.0/src/util/vircgroupv1.c:368:26: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-12.5.0/src/util/vircgroupv1.c:332:1: enter_function: entry to ‘virCgroupV1DetectPlacement’
libvirt-12.5.0/src/util/vircgroupv1.c:339:17: branch_true: following ‘true’ branch (when ‘i != 10’)...
libvirt-12.5.0/src/util/vircgroupv1.c:340:31: branch_true: ...to here
libvirt-12.5.0/src/util/vircgroupv1.c:344:14: call_function: calling ‘virCgroupV1MountOptsMatchController’ from ‘virCgroupV1DetectPlacement’
libvirt-12.5.0/src/util/vircgroupv1.c:344:14: return_function: returning to ‘virCgroupV1DetectPlacement’ from ‘virCgroupV1MountOptsMatchController’
libvirt-12.5.0/src/util/vircgroupv1.c:368:26: danger: argument 1 (‘<unknown>’) NULL where non-null expected
#  366|               group->legacy[i].placement = g_strdup(placement);
#  367|           } else {
#  368|->             bool delim = STREQ(placement, "/") || STREQ(path, "");
#  369|   
#  370|               group->legacy[i].placement = g_strdup_printf("%s%s%s", placement,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def131]
libvirt-12.5.0/src/util/virdaemon.c:66:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(stdinfd, 0)’
libvirt-12.5.0/src/util/virdaemon.c:43:1: enter_function: entry to ‘virDaemonForkIntoBackground’
libvirt-12.5.0/src/util/virdaemon.c:48:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/util/virdaemon.c:51:11: branch_false: ...to here
libvirt-12.5.0/src/util/virdaemon.c:62:16: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/util/virdaemon.c:64:29: call_function: inlined call to ‘open’ from ‘virDaemonForkIntoBackground’
libvirt-12.5.0/src/util/virdaemon.c:64:16: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/util/virdaemon.c:66:17: branch_false: ...to here
libvirt-12.5.0/src/util/virdaemon.c:66:17: acquire_resource: opened here
libvirt-12.5.0/src/util/virdaemon.c:66:16: danger: ‘dup2(stdinfd, 0)’ leaks here; was opened at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
#   64|               if ((stdoutfd = open("/dev/null", O_WRONLY)) < 0)
#   65|                   goto cleanup;
#   66|->             if (dup2(stdinfd, STDIN_FILENO) != STDIN_FILENO)
#   67|                   goto cleanup;
#   68|               if (dup2(stdoutfd, STDOUT_FILENO) != STDOUT_FILENO)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def132]
libvirt-12.5.0/src/util/virdaemon.c:68:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(stdoutfd, 1)’
libvirt-12.5.0/src/util/virdaemon.c:43:1: enter_function: entry to ‘virDaemonForkIntoBackground’
libvirt-12.5.0/src/util/virdaemon.c:48:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/util/virdaemon.c:51:11: branch_false: ...to here
libvirt-12.5.0/src/util/virdaemon.c:62:16: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/util/virdaemon.c:64:29: call_function: inlined call to ‘open’ from ‘virDaemonForkIntoBackground’
libvirt-12.5.0/src/util/virdaemon.c:64:16: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/util/virdaemon.c:66:17: branch_false: ...to here
libvirt-12.5.0/src/util/virdaemon.c:66:16: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/util/virdaemon.c:68:17: branch_false: ...to here
libvirt-12.5.0/src/util/virdaemon.c:68:17: acquire_resource: opened here
libvirt-12.5.0/src/util/virdaemon.c:68:16: danger: ‘dup2(stdoutfd, 1)’ leaks here; was opened at [(13)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/12)
#   66|               if (dup2(stdinfd, STDIN_FILENO) != STDIN_FILENO)
#   67|                   goto cleanup;
#   68|->             if (dup2(stdoutfd, STDOUT_FILENO) != STDOUT_FILENO)
#   69|                   goto cleanup;
#   70|               if (dup2(stdoutfd, STDERR_FILENO) != STDERR_FILENO)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def133]
libvirt-12.5.0/src/util/virdaemon.c:70:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(stdoutfd, 2)’
libvirt-12.5.0/src/util/virdaemon.c:43:1: enter_function: entry to ‘virDaemonForkIntoBackground’
libvirt-12.5.0/src/util/virdaemon.c:48:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/util/virdaemon.c:51:11: branch_false: ...to here
libvirt-12.5.0/src/util/virdaemon.c:62:16: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/util/virdaemon.c:64:29: call_function: inlined call to ‘open’ from ‘virDaemonForkIntoBackground’
libvirt-12.5.0/src/util/virdaemon.c:64:16: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/util/virdaemon.c:66:17: branch_false: ...to here
libvirt-12.5.0/src/util/virdaemon.c:66:16: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/util/virdaemon.c:68:17: branch_false: ...to here
libvirt-12.5.0/src/util/virdaemon.c:68:16: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/util/virdaemon.c:70:17: branch_false: ...to here
libvirt-12.5.0/src/util/virdaemon.c:70:17: acquire_resource: opened here
libvirt-12.5.0/src/util/virdaemon.c:70:16: danger: ‘dup2(stdoutfd, 2)’ leaks here; was opened at [(15)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/14)
#   68|               if (dup2(stdoutfd, STDOUT_FILENO) != STDOUT_FILENO)
#   69|                   goto cleanup;
#   70|->             if (dup2(stdoutfd, STDERR_FILENO) != STDERR_FILENO)
#   71|                   goto cleanup;
#   72|               if (VIR_CLOSE(stdinfd) < 0)

Error: GCC_ANALYZER_WARNING (CWE-688): [#def134]
libvirt-12.5.0/src/util/virfdstream.c:1363:9: warning[-Wanalyzer-null-argument]: use of NULL ‘path’ where non-null expected
libvirt-12.5.0/src/util/virfdstream.c:1263:1: enter_function: entry to ‘virFDStreamOpenFileInternal’
libvirt-12.5.0/src/util/virfdstream.c:1284:14: call_function: inlined call to ‘open’ from ‘virFDStreamOpenFileInternal’
libvirt-12.5.0/src/util/virfdstream.c:1287:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/util/virfdstream.c:1295:9: branch_false: ...to here
libvirt-12.5.0/src/util/virfdstream.c:1295:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/util/virfdstream.c:1302:8: branch_false: ...to here
libvirt-12.5.0/src/util/virfdstream.c:1315:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/util/virfdstream.c:1316:12: branch_true: ...to here
libvirt-12.5.0/src/util/virfdstream.c:1319:12: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/util/virfdstream.c:1326:13: branch_false: ...to here
libvirt-12.5.0/src/util/virfdstream.c:1326:12: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/util/virfdstream.c:1329:22: branch_false: ...to here
libvirt-12.5.0/src/util/virfdstream.c:1347:13: release_memory: ‘path’ is NULL
libvirt-12.5.0/src/util/virfdstream.c:1353:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/util/virfdstream.c:1354:9: branch_true: ...to here
libvirt-12.5.0/src/util/virfdstream.c:1362:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/util/virfdstream.c:1363:9: branch_true: ...to here
libvirt-12.5.0/src/util/virfdstream.c:1363:9: danger: argument 1 (‘path’) NULL where non-null expected
# 1361|       VIR_FORCE_CLOSE(pipefds[1]);
# 1362|       if (oflags & O_CREAT)
# 1363|->         unlink(path);
# 1364|       virFDStreamThreadDataFree(threadData);
# 1365|       return -1;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def135]
libvirt-12.5.0/src/util/virfile.c:2141:13: warning[-Wanalyzer-null-argument]: use of NULL ‘path’ where non-null expected
libvirt-12.5.0/src/util/virfile.c:2812:1: enter_function: entry to ‘virFileRemove’
libvirt-12.5.0/src/util/virfile.c:2821:10: call_function: calling ‘virFileRemoveNeedsSetuid’ from ‘virFileRemove’
libvirt-12.5.0/src/util/virfile.c:2821:10: return_function: returning to ‘virFileRemove’ from ‘virFileRemoveNeedsSetuid’
libvirt-12.5.0/src/util/virfile.c:2821:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/util/virfile.c:2832:8: branch_true: ...to here
libvirt-12.5.0/src/util/virfile.c:2841:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/util/virfile.c:2844:8: branch_false: ...to here
libvirt-12.5.0/src/util/virfile.c:2844:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/util/virfile.c:2870:9: branch_false: ...to here
libvirt-12.5.0/src/util/virfile.c:2870:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/util/virfile.c:2875:9: branch_false: ...to here
libvirt-12.5.0/src/util/virfile.c:2875:9: call_function: calling ‘virFileIsDir’ from ‘virFileRemove’
# 2139|   {
# 2140|       struct stat s;
# 2141|->     return (stat(path, &s) == 0) && S_ISDIR(s.st_mode);
# 2142|   }
# 2143|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def136]
libvirt-12.5.0/src/util/virfile.c:3763:12: warning[-Wanalyzer-null-argument]: use of NULL ‘path’ where non-null expected
libvirt-12.5.0/src/util/virfile.c:3768:1: enter_function: entry to ‘virFileIsSharedFSType’
libvirt-12.5.0/src/util/virfile.c:3771:22: release_memory: ‘dirpath’ is NULL
libvirt-12.5.0/src/util/virfile.c:3777:15: call_function: calling ‘virFileCheckParents’ from ‘virFileIsSharedFSType’
# 3761|                             void *opaque)
# 3762|   {
# 3763|->     return statfs(path, (struct statfs *) opaque) == 0;
# 3764|   }
# 3765|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def137]
libvirt-12.5.0/src/util/virfile.c:3813:9: warning[-Wanalyzer-null-argument]: use of NULL ‘path’ where non-null expected
libvirt-12.5.0/src/util/virfile.c:3871:1: enter_function: entry to ‘virFileFindHugeTLBFS’
libvirt-12.5.0/src/util/virfile.c:3882:8: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
libvirt-12.5.0/src/util/virfile.c:3882:8: branch_false: ...to here
libvirt-12.5.0/src/util/virfile.c:3889:12: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/util/virfile.c:3892:13: branch_true: ...to here
libvirt-12.5.0/src/util/virfile.c:3899:9: release_memory: using NULL here
libvirt-12.5.0/src/util/virfile.c:3901:13: call_function: calling ‘virFileGetHugepageSize’ from ‘virFileFindHugeTLBFS’
# 3811|       struct statfs fs;
# 3812|   
# 3813|->     if (statfs(path, &fs) < 0) {
# 3814|           virReportSystemError(errno,
# 3815|                                _("cannot determine filesystem for '%1$s'"),

Error: GCC_ANALYZER_WARNING (CWE-476): [#def138]
libvirt-12.5.0/src/util/virfirewall.c:1009:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
libvirt-12.5.0/src/util/virfirewall.c:977:1: enter_function: entry to ‘virFirewallNewFromRollback’
libvirt-12.5.0/src/util/virfirewall.c:983:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/util/virfirewall.c:989:16: branch_false: ...to here
libvirt-12.5.0/src/util/virfirewall.c:994:33: branch_true: following ‘true’ branch (when ‘g != 0’)...
libvirt-12.5.0/src/util/virfirewall.c:996:35: branch_true: ...to here
libvirt-12.5.0/src/util/virfirewall.c:1001:9: call_function: calling ‘virFirewallStartTransaction’ from ‘virFirewallNewFromRollback’
libvirt-12.5.0/src/util/virfirewall.c:1001:9: return_function: returning to ‘virFirewallNewFromRollback’ from ‘virFirewallStartTransaction’
libvirt-12.5.0/src/util/virfirewall.c:1003:36: branch_true: following ‘true’ branch (when ‘r != 0’)...
libvirt-12.5.0/src/util/virfirewall.c:1005:39: branch_true: ...to here
libvirt-12.5.0/src/util/virfirewall.c:1006:37: call_function: calling ‘virFirewallAddCmdFull’ from ‘virFirewallNewFromRollback’
libvirt-12.5.0/src/util/virfirewall.c:1006:37: return_function: returning to ‘virFirewallNewFromRollback’ from ‘virFirewallAddCmdFull’
libvirt-12.5.0/src/util/virfirewall.c:1008:25: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/util/virfirewall.c:1009:17: branch_true: ...to here
libvirt-12.5.0/src/util/virfirewall.c:1009:17: danger: dereference of NULL ‘virFirewallAddCmdFull(virFirewallNew(*original.backend), *origCmd.layer, 0, 0, 0, 0)’
# 1007|   
# 1008|               for (i = 0; i < origCmd->argsLen; i++)
# 1009|->                 ADD_ARG(rbCmd, origCmd->args[i]);
# 1010|           }
# 1011|       }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def139]
libvirt-12.5.0/src/util/virlockspace.c:94:17: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-12.5.0/src/util/virlockspace.c:111:1: enter_function: entry to ‘virLockSpaceResourceNew’
libvirt-12.5.0/src/util/virlockspace.c:126:23: call_function: calling ‘virLockSpaceGetResourcePath’ from ‘virLockSpaceResourceNew’
libvirt-12.5.0/src/util/virlockspace.c:126:23: return_function: returning to ‘virLockSpaceResourceNew’ from ‘virLockSpaceGetResourcePath’
libvirt-12.5.0/src/util/virlockspace.c:126:10: release_memory: using NULL here
libvirt-12.5.0/src/util/virlockspace.c:126:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/util/virlockspace.c:127:9: branch_true: ...to here
libvirt-12.5.0/src/util/virlockspace.c:220:5: call_function: calling ‘virLockSpaceResourceFree’ from ‘virLockSpaceResourceNew’
#   92|               }
#   93|           } else {
#   94|->             if (unlink(res->path) < 0 &&
#   95|                   errno != ENOENT) {
#   96|                   VIR_WARN("Failed to unlink resource %s: %s",

Error: GCC_ANALYZER_WARNING (CWE-476): [#def140]
libvirt-12.5.0/src/util/virmdev.c:400:48: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dev’
libvirt-12.5.0/src/util/virmdev.c:419:1: enter_function: entry to ‘virMediatedDeviceListMarkDevices’
libvirt-12.5.0/src/util/virmdev.c:429:17: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/util/virmdev.c:430:35: branch_true: ...to here
libvirt-12.5.0/src/util/virmdev.c:430:35: call_function: calling ‘virMediatedDeviceListGet’ from ‘virMediatedDeviceListMarkDevices’
libvirt-12.5.0/src/util/virmdev.c:430:35: return_function: returning to ‘virMediatedDeviceListMarkDevices’ from ‘virMediatedDeviceListGet’
libvirt-12.5.0/src/util/virmdev.c:430:28: release_memory: ‘mdev’ is NULL
libvirt-12.5.0/src/util/virmdev.c:432:13: call_function: calling ‘virMediatedDeviceIsUsed’ from ‘virMediatedDeviceListMarkDevices’
#  398|       virMediatedDevice *tmp = NULL;
#  399|   
#  400|->     if ((tmp = virMediatedDeviceListFind(list, dev->path))) {
#  401|           virMediatedDeviceGetUsedBy(tmp, &drvname, &domname);
#  402|           virReportError(VIR_ERR_OPERATION_INVALID,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def141]
libvirt-12.5.0/src/util/virobject.c:231:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘parent’
libvirt-12.5.0/src/util/virobject.c:297:1: enter_function: entry to ‘virObjectRWLockableNew’
libvirt-12.5.0/src/util/virobject.c:301:10: call_function: calling ‘virClassForObjectRWLockable’ from ‘virObjectRWLockableNew’
libvirt-12.5.0/src/util/virobject.c:301:10: return_function: returning to ‘virObjectRWLockableNew’ from ‘virClassForObjectRWLockable’
libvirt-12.5.0/src/util/virobject.c:301:10: call_function: calling ‘virClassIsDerivedFrom’ from ‘virObjectRWLockableNew’
#  229|   {
#  230|       while (klass) {
#  231|->         if (klass->magic == parent->magic)
#  232|               return true;
#  233|           klass = klass->parent;

Error: GCC_ANALYZER_WARNING (CWE-465): [#def142]
libvirt-12.5.0/src/util/virobject.c:330:12: warning[-Wanalyzer-deref-before-check]: check of ‘klass’ for NULL after already dereferencing it
#  328|       PROBE_DEBUG(OBJECT_DISPOSE, "obj=%p classname=%s", gobj, klass->name);
#  329|   
#  330|->     while (klass) {
#  331|           if (klass->dispose)
#  332|               klass->dispose(obj);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def143]
libvirt-12.5.0/src/util/virpcivpd.c:181:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘v’
libvirt-12.5.0/src/util/virpcivpd.c:597:1: enter_function: entry to ‘virPCIVPDParse’
libvirt-12.5.0/src/util/virpcivpd.c:615:12: branch_true: following ‘true’ branch...
libvirt-12.5.0/src/util/virpcivpd.c:617:13: branch_true: ...to here
libvirt-12.5.0/src/util/virpcivpd.c:617:13: call_function: calling ‘virPCIVPDReadVPDBytes’ from ‘virPCIVPDParse’
libvirt-12.5.0/src/util/virpcivpd.c:617:13: return_function: returning to ‘virPCIVPDParse’ from ‘virPCIVPDReadVPDBytes’
libvirt-12.5.0/src/util/virpcivpd.c:617:12: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/util/virpcivpd.c:621:13: branch_false: ...to here
libvirt-12.5.0/src/util/virpcivpd.c:645:12: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/util/virpcivpd.c:655:13: branch_false: ...to here
libvirt-12.5.0/src/util/virpcivpd.c:655:12: branch_false: following ‘false’ branch...
libvirt-12.5.0/src/util/virpcivpd.c:661:9: branch_false: ...to here
libvirt-12.5.0/src/util/virpcivpd.c:664:21: call_function: calling ‘virPCIVPDParseVPDLargeResourceString’ from ‘virPCIVPDParse’
#  179|       bool ret = true;
#  180|   
#  181|->     for (v = value; *v; v++) {
#  182|           if (!g_ascii_isprint(*v)) {
#  183|               ret = false;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def144]
libvirt-12.5.0/src/util/virrotatingfile.c:183:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-12.5.0/src/util/virrotatingfile.c:229:1: enter_function: entry to ‘virRotatingFileWriterNew’
libvirt-12.5.0/src/util/virrotatingfile.c:241:8: branch_false: following ‘false’ branch (when ‘maxbackup <= 32’)...
libvirt-12.5.0/src/util/virrotatingfile.c:248:5: branch_false: ...to here
libvirt-12.5.0/src/util/virrotatingfile.c:252:8: branch_true: following ‘true’ branch (when ‘trunc != 0’)...
libvirt-12.5.0/src/util/virrotatingfile.c:253:9: branch_true: ...to here
libvirt-12.5.0/src/util/virrotatingfile.c:253:9: call_function: calling ‘virRotatingFileWriterDelete’ from ‘virRotatingFileWriterNew’
#  181|       size_t i;
#  182|   
#  183|->     if (unlink(file->basepath) < 0 &&
#  184|           errno != ENOENT) {
#  185|           virReportSystemError(errno,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def145]
libvirt-12.5.0/tools/virsh-completer-checkpoint.c:69:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
libvirt-12.5.0/tools/virsh-completer-checkpoint.c:39:5: branch_false: following ‘false’ branch (when ‘flags == 0’)...
libvirt-12.5.0/tools/virsh-completer-checkpoint.c:41:10: branch_false: ...to here
libvirt-12.5.0/tools/virsh-completer-checkpoint.c:41:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/tools/virsh-completer-checkpoint.c:44:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/tools/virsh-completer-checkpoint.c:47:25: branch_false: ...to here
libvirt-12.5.0/tools/virsh-completer-checkpoint.c:47:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/tools/virsh-completer-checkpoint.c:49:9: branch_true: ...to here
libvirt-12.5.0/tools/virsh-completer-checkpoint.c:68:17: branch_true: following ‘true’ branch...
libvirt-12.5.0/tools/virsh-completer-checkpoint.c:69:19: branch_true: ...to here
libvirt-12.5.0/tools/virsh-completer-checkpoint.c:69:9: danger: dereference of NULL ‘(char **)(i * 8)’
#   67|       g_free(checkpoints);
#   68|       for (i = 0; i < ncheckpoints; i++)
#   69|->         g_free(ret[i]);
#   70|       g_free(ret);
#   71|       return NULL;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def146]
libvirt-12.5.0/tools/virsh-domain-monitor.c:1709:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘_pp’
libvirt-12.5.0/tools/virsh-domain-monitor.c:1511:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/tools/virsh-domain-monitor.c:1518:9: branch_false: ...to here
libvirt-12.5.0/tools/virsh-domain-monitor.c:1518:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/tools/virsh-domain-monitor.c:1548:12: branch_false: following ‘false’ branch...
libvirt-12.5.0/tools/virsh-domain-monitor.c:1553:12: branch_false: ...to here
libvirt-12.5.0/tools/virsh-domain-monitor.c:1553:12: branch_true: following ‘true’ branch...
libvirt-12.5.0/tools/virsh-domain-monitor.c:1554:19: branch_true: ...to here
libvirt-12.5.0/tools/virsh-domain-monitor.c:1708:17: branch_true: following ‘true’ branch...
libvirt-12.5.0/tools/virsh-domain-monitor.c:1709:9: danger: dereference of NULL ‘_pp’
# 1707|    cleanup:
# 1708|       for (i = 0; nnames != -1 && i < nnames; i++)
# 1709|->         VIR_FREE(names[i]);
# 1710|   
# 1711|       if (!success) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def147]
libvirt-12.5.0/tools/virsh-domain.c:9273:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
libvirt-12.5.0/tools/virsh-domain.c:9265:12: enter_function: entry to ‘getSignalNumber’
libvirt-12.5.0/tools/virsh-domain.c:9272:17: branch_true: following ‘true’ branch...
libvirt-12.5.0/tools/virsh-domain.c:9273:10: branch_true: ...to here
libvirt-12.5.0/tools/virsh-domain.c:9273:10: release_memory: using NULL here
libvirt-12.5.0/tools/virsh-domain.c:9273:9: danger: dereference of NULL ‘<unknown> + i’
# 9271|   
# 9272|       for (i = 0; signame[i]; i++)
# 9273|->         p[i] = g_ascii_tolower(signame[i]);
# 9274|   
# 9275|       if (virStrToLong_i(p, NULL, 10, &signum) >= 0)

Error: GCC_ANALYZER_WARNING (CWE-688): [#def148]
libvirt-12.5.0/tools/virsh-domain.c:9278:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-12.5.0/tools/virsh-domain.c:9265:12: enter_function: entry to ‘getSignalNumber’
libvirt-12.5.0/tools/virsh-domain.c:9272:17: branch_false: following ‘false’ branch...
libvirt-12.5.0/tools/virsh-domain.c:9275:9: branch_false: ...to here
libvirt-12.5.0/tools/virsh-domain.c:9275:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/tools/virsh-domain.c:9278:9: branch_false: ...to here
libvirt-12.5.0/tools/virsh-domain.c:9278:9: danger: argument 1 (‘<unknown>’) NULL where non-null expected
# 9276|           return signum;
# 9277|   
# 9278|->     if (STRPREFIX(p, "sig_"))
# 9279|           p += 4;
# 9280|       else if (STRPREFIX(p, "sig"))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def149]
libvirt-12.5.0/tools/virsh-interface.c:295:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘_pp’
libvirt-12.5.0/tools/virsh-interface.c:294:17: branch_true: following ‘true’ branch...
libvirt-12.5.0/tools/virsh-interface.c:295:9: danger: dereference of NULL ‘_pp’
#  293|    cleanup:
#  294|       for (i = 0; nActiveIfaces != -1 && i < nActiveIfaces; i++)
#  295|->         VIR_FREE(activeNames[i]);
#  296|   
#  297|       for (i = 0; nInactiveIfaces != -1 && i < nInactiveIfaces; i++)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def150]
libvirt-12.5.0/tools/virsh-interface.c:298:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘_pp’
libvirt-12.5.0/tools/virsh-interface.c:194:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/tools/virsh-interface.c:202:9: branch_false: ...to here
libvirt-12.5.0/tools/virsh-interface.c:202:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/tools/virsh-interface.c:214:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/tools/virsh-interface.c:215:25: branch_true: ...to here
libvirt-12.5.0/tools/virsh-interface.c:216:12: branch_false: following ‘false’ branch...
libvirt-12.5.0/tools/virsh-interface.c:220:12: branch_false: ...to here
libvirt-12.5.0/tools/virsh-interface.c:220:12: branch_true: following ‘true’ branch...
libvirt-12.5.0/tools/virsh-interface.c:221:27: branch_true: ...to here
libvirt-12.5.0/tools/virsh-interface.c:297:17: branch_true: following ‘true’ branch...
libvirt-12.5.0/tools/virsh-interface.c:298:9: danger: dereference of NULL ‘_pp’
#  296|   
#  297|       for (i = 0; nInactiveIfaces != -1 && i < nInactiveIfaces; i++)
#  298|->         VIR_FREE(inactiveNames[i]);
#  299|   
#  300|       VIR_FREE(activeNames);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def151]
libvirt-12.5.0/tools/virsh-nodedev.c:343:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘_pp’
libvirt-12.5.0/tools/virsh-nodedev.c:251:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/tools/virsh-nodedev.c:252:9: branch_true: ...to here
libvirt-12.5.0/tools/virsh-nodedev.c:342:17: branch_true: following ‘true’ branch...
libvirt-12.5.0/tools/virsh-nodedev.c:343:9: danger: dereference of NULL ‘_pp’
#  341|    cleanup:
#  342|       for (i = 0; ndevices != -1 && i < ndevices; i++)
#  343|->         VIR_FREE(names[i]);
#  344|       VIR_FREE(names);
#  345|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def152]
libvirt-12.5.0/tools/virsh-nwfilter.c:327:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘_pp’
libvirt-12.5.0/tools/virsh-nwfilter.c:283:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/tools/virsh-nwfilter.c:284:9: branch_true: ...to here
libvirt-12.5.0/tools/virsh-nwfilter.c:326:17: branch_true: following ‘true’ branch...
libvirt-12.5.0/tools/virsh-nwfilter.c:327:9: danger: dereference of NULL ‘_pp’
#  325|    cleanup:
#  326|       for (i = 0; nfilters != -1 && i < nfilters; i++)
#  327|->         VIR_FREE(names[i]);
#  328|       VIR_FREE(names);
#  329|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def153]
libvirt-12.5.0/tools/virsh-secret.c:240:22: warning[-Wanalyzer-null-argument]: use of NULL ‘secret_val’ where non-null expected
libvirt-12.5.0/tools/virsh-secret.c:210:1: enter_function: entry to ‘cmdSecretSetValue’
libvirt-12.5.0/tools/virsh-secret.c:215:22: release_memory: ‘secret_val’ is NULL
libvirt-12.5.0/tools/virsh-secret.c:227:20: call_function: calling ‘virshCommandOptSecret’ from ‘cmdSecretSetValue’
libvirt-12.5.0/tools/virsh-secret.c:227:20: return_function: returning to ‘cmdSecretSetValue’ from ‘virshCommandOptSecret’
libvirt-12.5.0/tools/virsh-secret.c:227:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/tools/virsh-secret.c:230:9: branch_false: ...to here
libvirt-12.5.0/tools/virsh-secret.c:230:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/tools/virsh-secret.c:233:9: branch_false: ...to here
libvirt-12.5.0/tools/virsh-secret.c:233:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/tools/virsh-secret.c:236:9: branch_false: ...to here
libvirt-12.5.0/tools/virsh-secret.c:236:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/tools/virsh-secret.c:238:9: branch_true: ...to here
libvirt-12.5.0/tools/virsh-secret.c:240:22: danger: argument 1 (‘<unknown>’) NULL where non-null expected
#  238|           vshWarn(ctl, "%s", _("Passing secret value as command-line argument is insecure!"));
#  239|           secret_val = g_strdup(base64);
#  240|->         secret_len = strlen(secret_val);
#  241|       } else if (filename) {
#  242|           ssize_t read_ret;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def154]
libvirt-12.5.0/tools/virsh-volume.c:1381:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘volInfoTexts’
libvirt-12.5.0/tools/virsh-volume.c:1325:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/tools/virsh-volume.c:1328:18: branch_false: ...to here
libvirt-12.5.0/tools/virsh-volume.c:1328:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/tools/virsh-volume.c:1331:9: branch_false: ...to here
libvirt-12.5.0/tools/virsh-volume.c:1331:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/tools/virsh-volume.c:1335:5: branch_false: ...to here
libvirt-12.5.0/tools/virsh-volume.c:1335:17: branch_false: following ‘false’ branch...
libvirt-12.5.0/tools/virsh-volume.c:1374:8: branch_false: ...to here
libvirt-12.5.0/tools/virsh-volume.c:1374:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/tools/virsh-volume.c:1376:17: branch_false: ...to here
libvirt-12.5.0/tools/virsh-volume.c:1377:12: branch_false: following ‘false’ branch...
libvirt-12.5.0/tools/virsh-volume.c:1377:12: branch_false: ...to here
libvirt-12.5.0/tools/virsh-volume.c:1380:21: branch_true: following ‘true’ branch...
libvirt-12.5.0/tools/virsh-volume.c:1383:47: branch_true: ...to here
libvirt-12.5.0/tools/virsh-volume.c:1381:17: danger: dereference of NULL ‘volInfoTexts + i * 32’
# 1379|   
# 1380|           for (i = 0; i < list->nvols; i++) {
# 1381|->             if (vshTableRowAppend(table,
# 1382|                                     virStorageVolGetName(list->vols[i]),
# 1383|                                     volInfoTexts[i].path,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def155]
libvirt-12.5.0/tools/virsh-volume.c:1404:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘volInfoTexts’
libvirt-12.5.0/tools/virsh-volume.c:1325:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/tools/virsh-volume.c:1328:18: branch_false: ...to here
libvirt-12.5.0/tools/virsh-volume.c:1328:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/tools/virsh-volume.c:1331:9: branch_false: ...to here
libvirt-12.5.0/tools/virsh-volume.c:1331:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/tools/virsh-volume.c:1335:5: branch_false: ...to here
libvirt-12.5.0/tools/virsh-volume.c:1335:17: branch_false: following ‘false’ branch...
libvirt-12.5.0/tools/virsh-volume.c:1374:8: branch_false: ...to here
libvirt-12.5.0/tools/virsh-volume.c:1374:8: branch_true: following ‘true’ branch...
libvirt-12.5.0/tools/virsh-volume.c:1398:13: branch_true: ...to here
libvirt-12.5.0/tools/virsh-volume.c:1399:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/tools/virsh-volume.c:1399:8: branch_false: ...to here
libvirt-12.5.0/tools/virsh-volume.c:1403:17: branch_true: following ‘true’ branch...
libvirt-12.5.0/tools/virsh-volume.c:1409:43: branch_true: ...to here
libvirt-12.5.0/tools/virsh-volume.c:1404:13: danger: dereference of NULL ‘volInfoTexts + i * 32’
# 1402|       /* Insert the volume info rows into table */
# 1403|       for (i = 0; i < list->nvols; i++) {
# 1404|->         if (vshTableRowAppend(table,
# 1405|                                 virStorageVolGetName(list->vols[i]),
# 1406|                                 volInfoTexts[i].path,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def156]
libvirt-12.5.0/tools/virsh-volume.c:1425:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘volInfoTexts’
libvirt-12.5.0/tools/virsh-volume.c:1325:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/tools/virsh-volume.c:1328:18: branch_false: ...to here
libvirt-12.5.0/tools/virsh-volume.c:1328:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/tools/virsh-volume.c:1331:9: branch_false: ...to here
libvirt-12.5.0/tools/virsh-volume.c:1331:8: branch_false: following ‘false’ branch...
libvirt-12.5.0/tools/virsh-volume.c:1335:5: branch_false: ...to here
libvirt-12.5.0/tools/virsh-volume.c:1335:17: branch_false: following ‘false’ branch...
libvirt-12.5.0/tools/virsh-volume.c:1374:8: branch_false: ...to here
libvirt-12.5.0/tools/virsh-volume.c:1377:12: branch_true: following ‘true’ branch...
libvirt-12.5.0/tools/virsh-volume.c:1378:13: branch_true: ...to here
libvirt-12.5.0/tools/virsh-volume.c:1422:9: branch_true: following ‘true’ branch...
libvirt-12.5.0/tools/virsh-volume.c:1422:9: branch_true: ...to here
libvirt-12.5.0/tools/virsh-volume.c:1423:21: branch_true: following ‘true’ branch...
libvirt-12.5.0/tools/virsh-volume.c:1425:13: branch_true: ...to here
libvirt-12.5.0/tools/virsh-volume.c:1425:13: danger: dereference of NULL ‘volInfoTexts + i * 32’
# 1423|           for (i = 0; i < list->nvols; i++) {
# 1424|               /* Cleanup the memory for one volume info structure per loop */
# 1425|->             VIR_FREE(volInfoTexts[i].path);
# 1426|               VIR_FREE(volInfoTexts[i].type);
# 1427|               VIR_FREE(volInfoTexts[i].capacity);

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-226.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-namelibvirt-12.5.0-2.fc45
store-results-to/tmp/tmprmvnx5aj/libvirt-12.5.0-2.fc45.tar.xz
time-created2026-08-03 18:17:38
time-finished2026-08-03 18:28:10
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,unicontrol,shellcheck,cppcheck' '-o' '/tmp/tmprmvnx5aj/libvirt-12.5.0-2.fc45.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmprmvnx5aj/libvirt-12.5.0-2.fc45.src.rpm'
tool-versioncsmock-3.8.7.20260803.142340.gb75b18e-1.el9