libvirt-11.2.0-1.fc43

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="$(run_virsh_c "$uri" list --uuid $persistent)"

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="$(run_virsh_c "$uri" list --uuid $persistent)"
#  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="$(run_virsh_c "$uri" list --uuid $persistent)"
#  110|   
#  111|       if [ $? -ne 0 ]; then

Error: SHELLCHECK_WARNING (CWE-571): [#def6]
/usr/libexec/libvirt-guests.sh:109:11: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  107|       local uri="$1"
#  108|       local persistent="$2"
#  109|->     local list="$(run_virsh_c "$uri" list --uuid $persistent)"
#  110|   
#  111|       if [ $? -ne 0 ]; then

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

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

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

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

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

Error: SHELLCHECK_WARNING (CWE-571): [#def12]
/usr/libexec/libvirt-guests.sh:134:11: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  132|       local uri="$1"
#  133|       local uuid="$2"
#  134|->     local id="$(run_virsh "$uri" domid "$uuid")"
#  135|   
#  136|       guest_running="false"

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Error: SHELLCHECK_WARNING (CWE-571): [#def71]
/usr/libexec/libvirt-guests.sh:485:15: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  483|           eval_gettext "Running guests on \$uri URI: "
#  484|   
#  485|->         local list="$(list_guests "$uri")"
#  486|           if [ $? -eq 0 ]; then
#  487|               local empty=true

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

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

Error: SHELLCHECK_WARNING (CWE-571): [#def74]
/usr/libexec/libvirt-guests.sh:501:19: warning[SC2155]: Declare and assign separately to avoid masking return values.
#  499|   
#  500|           if "$persistent_only"; then
#  501|->             local transient="$(list_guests "$uri" "--transient")"
#  502|               if [ $? -eq 0 ]; then
#  503|                   local empty="true"

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

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

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

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

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

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

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

Error: GCC_ANALYZER_WARNING (CWE-479): [#def82]
libvirt-11.2.0/redhat-linux-build/../examples/c/misc/event-test.c:1132:5: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘printf’ from within signal handler
libvirt-11.2.0/redhat-linux-build/../examples/c/misc/event-test.c:1247:1: enter_function: entry to ‘main’
libvirt-11.2.0/redhat-linux-build/../examples/c/misc/event-test.c:1259:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../examples/c/misc/event-test.c:1264:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../examples/c/misc/event-test.c:1264:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../examples/c/misc/event-test.c:1270:13: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../examples/c/misc/event-test.c:1273:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../examples/c/misc/event-test.c:1278:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../examples/c/misc/event-test.c:1278:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../examples/c/misc/event-test.c:1286:5: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../examples/c/misc/event-test.c:1130:1: enter_function: entry to ‘stop’
libvirt-11.2.0/redhat-linux-build/../examples/c/misc/event-test.c:1132:5: danger: call to ‘printf’ from within signal handler
# 1130|   stop(int sig)
# 1131|   {
# 1132|->     printf("Exiting on signal %d\n", sig);
# 1133|       run = 0;
# 1134|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def83]
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_driver.c:1807:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘vcpuinfo’
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_driver.c:1768:5: branch_false: following ‘false’ branch (when ‘__unsuppflags == 0’)...
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_driver.c:1771:11: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_driver.c:1773:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_driver.c:1776:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_driver.c:1776:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_driver.c:1779:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_driver.c:1779:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_driver.c:1782:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_driver.c:1782:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_driver.c:1785:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_driver.c:1785:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_driver.c:1793:21: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_driver.c:1793:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_driver.c:1796:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_driver.c:1796:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_driver.c:1802:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_driver.c:1806:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_driver.c:1807:9: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_driver.c:1807:9: danger: dereference of NULL ‘vcpuinfo’
# 1805|   
# 1806|       if (persistentDef) {
# 1807|->         virBitmapFree(vcpuinfo->cpumask);
# 1808|           vcpuinfo->cpumask = g_steal_pointer(&pcpumap);
# 1809|           goto endjob;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def84]
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_monitor.c:562:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘chMonitorCreateSocket(*(virCHMonitor *)<unknown>.socketpath)’
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_monitor.c:583:1: enter_function: entry to ‘virCHMonitorNew’
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_monitor.c:590:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_monitor.c:593:17: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_monitor.c:593:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_monitor.c:597:5: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_monitor.c:599:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_monitor.c:606:23: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_monitor.c:607:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_monitor.c:614:30: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_monitor.c:614:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_monitor.c:623:60: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_monitor.c:647:17: call_function: calling ‘chMonitorCreateSocket’ from ‘virCHMonitorNew’
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_monitor.c:647:17: return_function: returning to ‘virCHMonitorNew’ from ‘chMonitorCreateSocket’
libvirt-11.2.0/redhat-linux-build/../src/ch/ch_monitor.c:562:9: danger: ‘chMonitorCreateSocket(*(virCHMonitor *)<unknown>.socketpath)’ leaks here
#  560|       }
#  561|   
#  562|->     if (listen(fd, 1) < 0) {
#  563|           virReportSystemError(errno,
#  564|                                _("Unable to listen to UNIX socket path '%1$s'"),

Error: GCC_ANALYZER_WARNING (CWE-688): [#def85]
libvirt-11.2.0/redhat-linux-build/../src/conf/nwfilter_params.c:416:13: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-11.2.0/redhat-linux-build/../src/conf/nwfilter_params.c:393:1: enter_function: entry to ‘virNWFilterVarCombIterEntryAreUniqueEntries’
libvirt-11.2.0/redhat-linux-build/../src/conf/nwfilter_params.c:402:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/conf/nwfilter_params.c:408:13: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/conf/nwfilter_params.c:408:13: call_function: calling ‘virNWFilterVarValueGetNthValue’ from ‘virNWFilterVarCombIterEntryAreUniqueEntries’
libvirt-11.2.0/redhat-linux-build/../src/conf/nwfilter_params.c:408:13: return_function: returning to ‘virNWFilterVarCombIterEntryAreUniqueEntries’ from ‘virNWFilterVarValueGetNthValue’
libvirt-11.2.0/redhat-linux-build/../src/conf/nwfilter_params.c:409:8: branch_false: following ‘false’ branch...
 branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/conf/nwfilter_params.c:415:17: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/conf/nwfilter_params.c:416:13: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/conf/nwfilter_params.c:416:13: call_function: calling ‘virNWFilterVarValueGetNthValue’ from ‘virNWFilterVarCombIterEntryAreUniqueEntries’
libvirt-11.2.0/redhat-linux-build/../src/conf/nwfilter_params.c:416:13: return_function: returning to ‘virNWFilterVarCombIterEntryAreUniqueEntries’ from ‘virNWFilterVarValueGetNthValue’
libvirt-11.2.0/redhat-linux-build/../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): [#def86]
libvirt-11.2.0/redhat-linux-build/../src/conf/nwfilter_params.c:424:21: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-11.2.0/redhat-linux-build/../src/conf/nwfilter_params.c:393:1: enter_function: entry to ‘virNWFilterVarCombIterEntryAreUniqueEntries’
libvirt-11.2.0/redhat-linux-build/../src/conf/nwfilter_params.c:402:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/conf/nwfilter_params.c:408:13: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/conf/nwfilter_params.c:408:13: call_function: calling ‘virNWFilterVarValueGetNthValue’ from ‘virNWFilterVarCombIterEntryAreUniqueEntries’
libvirt-11.2.0/redhat-linux-build/../src/conf/nwfilter_params.c:408:13: return_function: returning to ‘virNWFilterVarCombIterEntryAreUniqueEntries’ from ‘virNWFilterVarValueGetNthValue’
libvirt-11.2.0/redhat-linux-build/../src/conf/nwfilter_params.c:409:8: branch_false: following ‘false’ branch...
 branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/conf/nwfilter_params.c:415:17: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/conf/nwfilter_params.c:416:13: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/conf/nwfilter_params.c:416:13: call_function: calling ‘virNWFilterVarValueGetNthValue’ from ‘virNWFilterVarCombIterEntryAreUniqueEntries’
libvirt-11.2.0/redhat-linux-build/../src/conf/nwfilter_params.c:416:13: return_function: returning to ‘virNWFilterVarCombIterEntryAreUniqueEntries’ from ‘virNWFilterVarValueGetNthValue’
libvirt-11.2.0/redhat-linux-build/../src/conf/nwfilter_params.c:416:12: branch_true: following ‘true’ branch (when the strings are equal)...
 branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/conf/nwfilter_params.c:418:25: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/conf/nwfilter_params.c:419:43: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/conf/nwfilter_params.c:420:20: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/conf/nwfilter_params.c:424:21: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/conf/nwfilter_params.c:424:21: call_function: calling ‘virNWFilterVarValueGetNthValue’ from ‘virNWFilterVarCombIterEntryAreUniqueEntries’
libvirt-11.2.0/redhat-linux-build/../src/conf/nwfilter_params.c:424:21: return_function: returning to ‘virNWFilterVarCombIterEntryAreUniqueEntries’ from ‘virNWFilterVarValueGetNthValue’
libvirt-11.2.0/redhat-linux-build/../src/conf/nwfilter_params.c:424:21: call_function: calling ‘virNWFilterVarValueGetNthValue’ from ‘virNWFilterVarCombIterEntryAreUniqueEntries’
libvirt-11.2.0/redhat-linux-build/../src/conf/nwfilter_params.c:424:21: return_function: returning to ‘virNWFilterVarCombIterEntryAreUniqueEntries’ from ‘virNWFilterVarValueGetNthValue’
libvirt-11.2.0/redhat-linux-build/../src/conf/nwfilter_params.c:424:21: danger: argument 2 (‘virNWFilterVarValueGetNthValue(virHashLookup(hash, *<unknown>), (unsigned int)i)’) 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): [#def87]
libvirt-11.2.0/redhat-linux-build/../src/conf/virchrdev.c:77:16: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-11.2.0/redhat-linux-build/../src/conf/virchrdev.c:66:14: enter_function: entry to ‘virChrdevLockFilePath’
libvirt-11.2.0/redhat-linux-build/../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): [#def88]
libvirt-11.2.0/redhat-linux-build/../src/conf/virstorageobj.c:1358:12: warning[-Wanalyzer-deref-before-check]: check of ‘obj’ for NULL after already dereferencing it
libvirt-11.2.0/redhat-linux-build/../src/conf/virstorageobj.c:1349:1: enter_function: entry to ‘virStoragePoolObjSourceMatchTypeDEVICE’
libvirt-11.2.0/redhat-linux-build/../src/conf/virstorageobj.c:1354:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/conf/virstorageobj.c:1355:13: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/conf/virstorageobj.c:1355:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/conf/virstorageobj.c:1358:25: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/conf/virstorageobj.c:1358:25: call_function: calling ‘virStoragePoolSourceFindDuplicateDevices’ from ‘virStoragePoolObjSourceMatchTypeDEVICE’
libvirt-11.2.0/redhat-linux-build/../src/conf/virstorageobj.c:1358:25: return_function: returning to ‘virStoragePoolObjSourceMatchTypeDEVICE’ from ‘virStoragePoolSourceFindDuplicateDevices’
libvirt-11.2.0/redhat-linux-build/../src/conf/virstorageobj.c:1358: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)
# 1356|               return NULL;
# 1357|   
# 1358|->         if ((matchobj = virStoragePoolSourceFindDuplicateDevices(obj, def))) {
# 1359|               if (!virStoragePoolSourceISCSIMatch(matchobj, def))
# 1360|                   return NULL;

Error: GCC_ANALYZER_WARNING (CWE-465): [#def89]
libvirt-11.2.0/redhat-linux-build/../src/conf/virstorageobj.c:1397:13: warning[-Wanalyzer-deref-before-check]: check of ‘payload’ for NULL after already dereferencing it
libvirt-11.2.0/redhat-linux-build/../src/conf/virstorageobj.c:1381:1: enter_function: entry to ‘virStoragePoolObjSourceFindDuplicateCb’
libvirt-11.2.0/redhat-linux-build/../src/conf/virstorageobj.c:1390:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
libvirt-11.2.0/redhat-linux-build/../src/conf/virstorageobj.c:1393:33: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/conf/virstorageobj.c:1397:12: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/conf/virstorageobj.c:1398:13: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/conf/virstorageobj.c:1398:13: call_function: calling ‘virStoragePoolObjSourceMatchTypeDIR’ from ‘virStoragePoolObjSourceFindDuplicateCb’
libvirt-11.2.0/redhat-linux-build/../src/conf/virstorageobj.c:1398:13: return_function: returning to ‘virStoragePoolObjSourceFindDuplicateCb’ from ‘virStoragePoolObjSourceMatchTypeDIR’
libvirt-11.2.0/redhat-linux-build/../src/conf/virstorageobj.c:1397: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)
# 1395|       case VIR_STORAGE_POOL_GLUSTER:
# 1396|       case VIR_STORAGE_POOL_NETFS:
# 1397|->         if (data->def->type == obj->def->type &&
# 1398|               virStoragePoolObjSourceMatchTypeDIR(obj, data->def))
# 1399|               return 1;

Error: GCC_ANALYZER_WARNING (CWE-465): [#def90]
libvirt-11.2.0/redhat-linux-build/../src/conf/virstorageobj.c:1403:13: warning[-Wanalyzer-deref-before-check]: check of ‘payload’ for NULL after already dereferencing it
libvirt-11.2.0/redhat-linux-build/../src/conf/virstorageobj.c:1381:1: enter_function: entry to ‘virStoragePoolObjSourceFindDuplicateCb’
libvirt-11.2.0/redhat-linux-build/../src/conf/virstorageobj.c:1390:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
libvirt-11.2.0/redhat-linux-build/../src/conf/virstorageobj.c:1393:33: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/conf/virstorageobj.c:1403:12: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/conf/virstorageobj.c:1404:13: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/conf/virstorageobj.c:1404:13: call_function: calling ‘virStoragePoolObjSourceMatchTypeISCSI’ from ‘virStoragePoolObjSourceFindDuplicateCb’
libvirt-11.2.0/redhat-linux-build/../src/conf/virstorageobj.c:1404:13: return_function: returning to ‘virStoragePoolObjSourceFindDuplicateCb’ from ‘virStoragePoolObjSourceMatchTypeISCSI’
libvirt-11.2.0/redhat-linux-build/../src/conf/virstorageobj.c:1403: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)
# 1401|   
# 1402|       case VIR_STORAGE_POOL_SCSI:
# 1403|->         if (data->def->type == obj->def->type &&
# 1404|               virStoragePoolObjSourceMatchTypeISCSI(obj, data->def))
# 1405|               return 1;

Error: GCC_ANALYZER_WARNING (CWE-465): [#def91]
libvirt-11.2.0/redhat-linux-build/../src/conf/virstorageobj.c:1413:13: warning[-Wanalyzer-deref-before-check]: check of ‘payload’ for NULL after already dereferencing it
libvirt-11.2.0/redhat-linux-build/../src/conf/virstorageobj.c:1381:1: enter_function: entry to ‘virStoragePoolObjSourceFindDuplicateCb’
libvirt-11.2.0/redhat-linux-build/../src/conf/virstorageobj.c:1390:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
libvirt-11.2.0/redhat-linux-build/../src/conf/virstorageobj.c:1393:33: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/conf/virstorageobj.c:1418:13: call_function: calling ‘virStoragePoolObjSourceMatchTypeDEVICE’ from ‘virStoragePoolObjSourceFindDuplicateCb’
libvirt-11.2.0/redhat-linux-build/../src/conf/virstorageobj.c:1418:13: return_function: returning to ‘virStoragePoolObjSourceFindDuplicateCb’ from ‘virStoragePoolObjSourceMatchTypeDEVICE’
libvirt-11.2.0/redhat-linux-build/../src/conf/virstorageobj.c:1413: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)
# 1411|       case VIR_STORAGE_POOL_DISK:
# 1412|       case VIR_STORAGE_POOL_ZFS:
# 1413|->         if ((data->def->type == VIR_STORAGE_POOL_ISCSI ||
# 1414|                data->def->type == VIR_STORAGE_POOL_FS ||
# 1415|                data->def->type == VIR_STORAGE_POOL_LOGICAL ||

Error: GCC_ANALYZER_WARNING (CWE-476): [#def92]
libvirt-11.2.0/redhat-linux-build/../src/esx/esx_util.c:219:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘saveptr’
libvirt-11.2.0/redhat-linux-build/../src/esx/esx_util.c:199:1: enter_function: entry to ‘esxUtil_ParseDatastorePath’
libvirt-11.2.0/redhat-linux-build/../src/esx/esx_util.c:205:11: release_memory: ‘saveptr’ is NULL
libvirt-11.2.0/redhat-linux-build/../src/esx/esx_util.c:219:17: danger: dereference of NULL ‘<unknown>’
#  217|   
#  218|       /* Expected format: '[<datastore>] <path>' where <path> is optional */
#  219|->     if (!(tmp = STRSKIP(copyOfDatastorePath, "[")) || *tmp == ']' ||
#  220|           !(preliminaryDatastoreName = strtok_r(tmp, "]", &saveptr))) {
#  221|           virReportError(VIR_ERR_INVALID_ARG,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def93]
libvirt-11.2.0/redhat-linux-build/../src/esx/esx_util.c:403:12: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘tmp’
libvirt-11.2.0/redhat-linux-build/../src/esx/esx_util.c:419:1: enter_function: entry to ‘esxUtil_EscapeDatastoreItem’
libvirt-11.2.0/redhat-linux-build/../src/esx/esx_util.c:426:5: call_function: calling ‘esxUtil_ReplaceSpecialWindowsPathChars’ from ‘esxUtil_EscapeDatastoreItem’
#  401|       size_t length;
#  402|   
#  403|->     while (*tmp != '\0') {
#  404|           length = strspn(tmp, specials);
#  405|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def94]
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:816:45: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘driveSettings’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2899:1: enter_function: entry to ‘hypervDomainDefineXML’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2902:33: call_function: calling ‘hypervConnectGetHostname’ from ‘hypervDomainDefineXML’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2902:33: return_function: returning to ‘hypervDomainDefineXML’ from ‘hypervConnectGetHostname’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2913:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2917:50: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2917:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2928:14: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2932:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2935:25: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2937:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2940:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2940:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2945:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2945:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2949:45: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2949:14: call_function: calling ‘hypervDomainLookupByName’ from ‘hypervDomainDefineXML’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2949:14: return_function: returning to ‘hypervDomainDefineXML’ from ‘hypervDomainLookupByName’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2952:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2956:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2956:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2960:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2960:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2964:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2964:9: call_function: calling ‘hypervDomainAttachStorage’ from ‘hypervDomainDefineXML’
#  814|           return -1;
#  815|   
#  816|->     vhdInstanceIdEscaped = virStringReplace(driveSettings->data->InstanceID, "\\", "\\\\");
#  817|       vfd__PATH = g_strdup_printf("\\\\%s\\Root\\Virtualization\\V2:"
#  818|                                   "Msvm_ResourceAllocationSettingData.InstanceID=\"%s\"",

Error: GCC_ANALYZER_WARNING (CWE-476): [#def95]
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:881:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘domain’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2899:1: enter_function: entry to ‘hypervDomainDefineXML’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2902:33: call_function: calling ‘hypervConnectGetHostname’ from ‘hypervDomainDefineXML’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2902:33: return_function: returning to ‘hypervDomainDefineXML’ from ‘hypervConnectGetHostname’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2913:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2917:50: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2917:19: call_function: calling ‘hypervDomainLookupByUUID’ from ‘hypervDomainDefineXML’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2917:19: return_function: returning to ‘hypervDomainDefineXML’ from ‘hypervDomainLookupByUUID’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2917:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2928:14: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2932:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2935:25: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2937:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2940:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2940:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2945:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2945:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2949:45: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2949:14: call_function: calling ‘hypervDomainLookupByName’ from ‘hypervDomainDefineXML’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2949:14: return_function: returning to ‘hypervDomainDefineXML’ from ‘hypervDomainLookupByName’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2952:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2956:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2956:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2960:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2960:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2964:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2964:9: call_function: calling ‘hypervDomainAttachStorage’ from ‘hypervDomainDefineXML’
#  879|   hypervDomainAttachStorage(virDomainPtr domain, virDomainDef *def, const char *hostname)
#  880|   {
#  881|->     hypervPrivate *priv = domain->conn->privateData;
#  882|       size_t i = 0;
#  883|       char uuid_string[VIR_UUID_STRING_BUFLEN];

Error: GCC_ANALYZER_WARNING (CWE-457): [#def96]
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:928:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘ideChannels[ctrlr_idx]’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2899:1: enter_function: entry to ‘hypervDomainDefineXML’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2902:33: call_function: calling ‘hypervConnectGetHostname’ from ‘hypervDomainDefineXML’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2902:33: return_function: returning to ‘hypervDomainDefineXML’ from ‘hypervConnectGetHostname’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2913:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2917:50: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2917:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2928:14: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2932:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2935:25: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2937:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2940:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2940:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2945:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2945:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2949:45: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2949:14: call_function: calling ‘hypervDomainLookupByName’ from ‘hypervDomainDefineXML’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2949:14: return_function: returning to ‘hypervDomainDefineXML’ from ‘hypervDomainLookupByName’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2952:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2956:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2956:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2960:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2960:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2964:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2964:9: call_function: calling ‘hypervDomainAttachStorage’ from ‘hypervDomainDefineXML’
#  926|           case VIR_DOMAIN_DISK_BUS_IDE:
#  927|               ctrlr_idx = def->disks[i]->info.addr.drive.bus;
#  928|->             if (hypervDomainAttachStorageVolume(domain, def->disks[i],
#  929|                                                   ideChannels[ctrlr_idx], hostname) < 0) {
#  930|                   return -1;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def97]
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:935:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘scsiControllers[ctrlr_idx]’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2899:1: enter_function: entry to ‘hypervDomainDefineXML’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2902:33: call_function: calling ‘hypervConnectGetHostname’ from ‘hypervDomainDefineXML’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2902:33: return_function: returning to ‘hypervDomainDefineXML’ from ‘hypervConnectGetHostname’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2913:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2917:50: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2917:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2928:14: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2932:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2935:25: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2937:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2940:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2940:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2945:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2945:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2949:45: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2949:14: call_function: calling ‘hypervDomainLookupByName’ from ‘hypervDomainDefineXML’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2949:14: return_function: returning to ‘hypervDomainDefineXML’ from ‘hypervDomainLookupByName’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2952:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2956:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2956:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2960:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2960:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2964:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2964:9: call_function: calling ‘hypervDomainAttachStorage’ from ‘hypervDomainDefineXML’
#  933|           case VIR_DOMAIN_DISK_BUS_SCSI:
#  934|               ctrlr_idx = def->disks[i]->info.addr.drive.controller;
#  935|->             if (hypervDomainAttachStorageVolume(domain, def->disks[i],
#  936|                                                   scsiControllers[ctrlr_idx], hostname) < 0) {
#  937|                   return -1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def98]
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2233:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘domain’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2899:1: enter_function: entry to ‘hypervDomainDefineXML’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2902:33: call_function: calling ‘hypervConnectGetHostname’ from ‘hypervDomainDefineXML’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2902:33: return_function: returning to ‘hypervDomainDefineXML’ from ‘hypervConnectGetHostname’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2913:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2917:50: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2917:19: call_function: calling ‘hypervDomainLookupByUUID’ from ‘hypervDomainDefineXML’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2917:19: return_function: returning to ‘hypervDomainDefineXML’ from ‘hypervDomainLookupByUUID’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2917:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2928:14: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2932:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2935:25: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2937:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2940:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2940:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2945:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2945:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2949:45: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2949:14: call_function: calling ‘hypervDomainLookupByName’ from ‘hypervDomainDefineXML’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2949:14: return_function: returning to ‘hypervDomainDefineXML’ from ‘hypervDomainLookupByName’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2952:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2956:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2956:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2956:36: call_function: inlined call to ‘hypervDomainSetMaxMemory’ from ‘hypervDomainDefineXML’
# 2231|   {
# 2232|       char uuid_string[VIR_UUID_STRING_BUFLEN];
# 2233|->     hypervPrivate *priv = domain->conn->privateData;
# 2234|       g_autoptr(Msvm_VirtualSystemSettingData) vssd = NULL;
# 2235|       g_autoptr(Msvm_MemorySettingData) memsd = NULL;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def99]
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2491:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘domain’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2899:1: enter_function: entry to ‘hypervDomainDefineXML’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2902:33: call_function: calling ‘hypervConnectGetHostname’ from ‘hypervDomainDefineXML’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2902:33: return_function: returning to ‘hypervDomainDefineXML’ from ‘hypervConnectGetHostname’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2913:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2917:50: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2917:19: call_function: calling ‘hypervDomainLookupByUUID’ from ‘hypervDomainDefineXML’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2917:19: return_function: returning to ‘hypervDomainDefineXML’ from ‘hypervDomainLookupByUUID’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2917:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2928:14: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2932:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2935:25: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2937:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2940:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2940:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2945:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2945:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2949:45: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2949:14: call_function: calling ‘hypervDomainLookupByName’ from ‘hypervDomainDefineXML’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2949:14: return_function: returning to ‘hypervDomainDefineXML’ from ‘hypervDomainLookupByName’
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2952:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2952:52: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_driver.c:2952:23: call_function: inlined call to ‘hypervDomainSetVcpus’ from ‘hypervDomainDefineXML’
# 2489|   {
# 2490|       char uuid_string[VIR_UUID_STRING_BUFLEN];
# 2491|->     hypervPrivate *priv = domain->conn->privateData;
# 2492|       g_autoptr(Msvm_VirtualSystemSettingData) vssd = NULL;
# 2493|       g_autoptr(Msvm_ProcessorSettingData) proc_sd = NULL;

Error: GCC_ANALYZER_WARNING (CWE-465): [#def100]
libvirt-11.2.0/redhat-linux-build/../src/hyperv/hyperv_wmi.c:1009:12: warning[-Wanalyzer-deref-before-check]: check of ‘object’ for NULL after already dereferencing it
# 1007|       serializerContext = wsmc_get_serialization_context(((hypervObject *)object)->priv->client);
# 1008|   
# 1009|->     while (object != NULL) {
# 1010|           next = ((hypervObject *)object)->next;
# 1011|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def101]
libvirt-11.2.0/redhat-linux-build/../src/interface/interface_backend_udev.c:992:27: warning[-Wanalyzer-null-argument]: use of NULL ‘name’ where non-null expected
libvirt-11.2.0/redhat-linux-build/../src/interface/interface_backend_udev.c:1029:1: enter_function: entry to ‘udevInterfaceGetXMLDesc’
libvirt-11.2.0/redhat-linux-build/../src/interface/interface_backend_udev.c:1036:5: branch_false: following ‘false’ branch (when ‘__unsuppflags == 0’)...
libvirt-11.2.0/redhat-linux-build/../src/interface/interface_backend_udev.c:1038:27: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/interface/interface_backend_udev.c:1043:16: call_function: calling ‘udevGetIfaceDef’ from ‘udevInterfaceGetXMLDesc’
#  990|            * to prevent false positives
#  991|            */
#  992|->         vlan_parent_dev = strrchr(name, '.');
#  993|           if (vlan_parent_dev)
#  994|               ifacedef->type = VIR_INTERFACE_TYPE_VLAN;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def102]
libvirt-11.2.0/redhat-linux-build/../src/libxl/libxl_driver.c:6279:46: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘iface’
libvirt-11.2.0/redhat-linux-build/../src/libxl/libxl_driver.c:6238:8: branch_false: following ‘false’ branch...
 branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/libxl/libxl_driver.c:6241:17: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/libxl/libxl_driver.c:6244:33: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/libxl/libxl_driver.c:6249:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/libxl/libxl_driver.c:6252:26: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/libxl/libxl_driver.c:6256:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/libxl/libxl_driver.c:6259:25: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/libxl/libxl_driver.c:6259:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/libxl/libxl_driver.c:6263:12: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/libxl/libxl_driver.c:6263:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/libxl/libxl_driver.c:6277:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/libxl/libxl_driver.c:6277:21: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/libxl/libxl_driver.c:6278:50: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/libxl/libxl_driver.c:6279:46: danger: dereference of NULL ‘iface’
# 6277|           for (j = 0; j < n_leases; j++) {
# 6278|               virNetworkDHCPLeasePtr lease = leases[j];
# 6279|->             virDomainIPAddressPtr ip_addr = &iface->addrs[j];
# 6280|   
# 6281|               ip_addr->addr = g_strdup(lease->ipaddr);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def103]
libvirt-11.2.0/redhat-linux-build/../src/libxl/libxl_logger.c:156:34: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(g_strdup_printf("%s/libxl-driver.log", logDir), "a")’
libvirt-11.2.0/redhat-linux-build/../src/libxl/libxl_logger.c:156:34: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../src/libxl/libxl_logger.c:156:34: danger: ‘fopen(g_strdup_printf("%s/libxl-driver.log", logDir), "a")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  154|       path = g_strdup_printf("%s/libxl-driver.log", logDir);
#  155|   
#  156|->     if ((logger.defaultLogFile = fopen(path, "a")) == NULL)
#  157|           return NULL;
#  158|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def104]
libvirt-11.2.0/redhat-linux-build/../src/libxl/libxl_logger.c:156:34: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(g_strdup_printf("%s/libxl-driver.log", logDir), "a")’
libvirt-11.2.0/redhat-linux-build/../src/libxl/libxl_logger.c:156:34: acquire_memory: allocated here
libvirt-11.2.0/redhat-linux-build/../src/libxl/libxl_logger.c:156:34: danger: ‘fopen(g_strdup_printf("%s/libxl-driver.log", logDir), "a")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  154|       path = g_strdup_printf("%s/libxl-driver.log", logDir);
#  155|   
#  156|->     if ((logger.defaultLogFile = fopen(path, "a")) == NULL)
#  157|           return NULL;
#  158|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def105]
libvirt-11.2.0/redhat-linux-build/../src/libxl/libxl_logger.c:193:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(g_strdup_printf("%s/%s.log", *logger.logDir,  name), "a")’
libvirt-11.2.0/redhat-linux-build/../src/libxl/libxl_logger.c:193:21: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../src/libxl/libxl_logger.c:193:21: danger: ‘fopen(g_strdup_printf("%s/%s.log", *logger.logDir,  name), "a")’ leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  191|       domidstr = g_strdup_printf("%d", id);
#  192|   
#  193|->     if (!(logFile = fopen(path, "a"))) {
#  194|           VIR_WARN("Failed to open log file %s: %s",
#  195|                    path, g_strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def106]
libvirt-11.2.0/redhat-linux-build/../src/libxl/libxl_logger.c:193:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(g_strdup_printf("%s/%s.log", *logger.logDir,  name), "a")’
libvirt-11.2.0/redhat-linux-build/../src/libxl/libxl_logger.c:193:21: acquire_memory: allocated here
libvirt-11.2.0/redhat-linux-build/../src/libxl/libxl_logger.c:193:21: danger: ‘fopen(g_strdup_printf("%s/%s.log", *logger.logDir,  name), "a")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  191|       domidstr = g_strdup_printf("%d", id);
#  192|   
#  193|->     if (!(logFile = fopen(path, "a"))) {
#  194|           VIR_WARN("Failed to open log file %s: %s",
#  195|                    path, g_strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def107]
libvirt-11.2.0/redhat-linux-build/../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-11.2.0/redhat-linux-build/../src/libxl/libxl_logger.c:193:21: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../src/libxl/libxl_logger.c:193:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/libxl/libxl_logger.c:198:5: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/libxl/libxl_logger.c:198:5: danger: ‘fopen(g_strdup_printf("%s/%s.log", *logger.logDir,  name), "a")’ leaks here; was opened at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  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): [#def108]
libvirt-11.2.0/redhat-linux-build/../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-11.2.0/redhat-linux-build/../src/libxl/libxl_logger.c:193:21: acquire_memory: allocated here
libvirt-11.2.0/redhat-linux-build/../src/libxl/libxl_logger.c:193:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/libxl/libxl_logger.c:198:5: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/libxl/libxl_logger.c:198:5: danger: ‘fopen(g_strdup_printf("%s/%s.log", *logger.logDir,  name), "a")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  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): [#def109]
libvirt-11.2.0/redhat-linux-build/../src/libxl/xen_xl.c:997:17: warning[-Wanalyzer-null-argument]: use of NULL ‘type’ where non-null expected
libvirt-11.2.0/redhat-linux-build/../src/libxl/xen_xl.c:955:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/libxl/xen_xl.c:957:16: branch_true: following ‘true’ branch (when ‘list’ is non-NULL)...
libvirt-11.2.0/redhat-linux-build/../src/libxl/xen_xl.c:963:18: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/libxl/xen_xl.c:963:16: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/libxl/xen_xl.c:967:20: branch_true: following ‘true’ branch (when ‘key’ is non-NULL)...
libvirt-11.2.0/redhat-linux-build/../src/libxl/xen_xl.c:969:33: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/libxl/xen_xl.c:971:20: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
libvirt-11.2.0/redhat-linux-build/../src/libxl/xen_xl.c:973:17: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/libxl/xen_xl.c:975:20: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/libxl/xen_xl.c:979:27: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/libxl/xen_xl.c:979:27: branch_true: following ‘true’ branch (when ‘name’ is NULL)...
libvirt-11.2.0/redhat-linux-build/../src/libxl/xen_xl.c:979:37: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/libxl/xen_xl.c:979:28: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/libxl/xen_xl.c:982:27: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/libxl/xen_xl.c:982:27: branch_true: following ‘true’ branch (when ‘path’ is NULL)...
libvirt-11.2.0/redhat-linux-build/../src/libxl/xen_xl.c:982:37: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/libxl/xen_xl.c:982:28: branch_false: following ‘false’ branch...
 branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/libxl/xen_xl.c:987:24: branch_false: following ‘false’ branch (when ‘nextkey’ is NULL)...
 branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/libxl/xen_xl.c:967:20: branch_false: following ‘false’ branch (when ‘key’ is NULL)...
libvirt-11.2.0/redhat-linux-build/../src/libxl/xen_xl.c:994:29: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/libxl/xen_xl.c:994:16: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/libxl/xen_xl.c:997:17: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../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): [#def110]
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:2966:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dev’
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4377:12: enter_function: entry to ‘lxcDomainAttachDeviceFlags’
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4389:5: branch_false: following ‘false’ branch (when ‘__unsuppflags == 0’)...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4392:16: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4392:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4395:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4395:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4398:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4398:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4401:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4401:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4404:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4404:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4411:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4411:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4412:26: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4412:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4418:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4418:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4420:17: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4421:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4424:13: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4424:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4429:20: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4429:20: call_function: calling ‘lxcDomainAttachDeviceConfig’ from ‘lxcDomainAttachDeviceFlags’
# 2964|       virDomainHostdevDef *hostdev;
# 2965|   
# 2966|->     switch (dev->type) {
# 2967|       case VIR_DOMAIN_DEVICE_DISK:
# 2968|           disk = dev->data.disk;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def111]
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:3110:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dev’
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4537:12: enter_function: entry to ‘lxcDomainDetachDeviceFlags’
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4552:5: branch_false: following ‘false’ branch (when ‘__unsuppflags == 0’)...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4555:16: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4555:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4558:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4558:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4561:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4561:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4564:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4564:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4567:18: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4567:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4570:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4570:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4576:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4576:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4577:26: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4577:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4582:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4582:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4584:17: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4585:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4588:20: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4588:20: call_function: calling ‘lxcDomainDetachDeviceConfig’ from ‘lxcDomainDetachDeviceFlags’
# 3108|       int idx;
# 3109|   
# 3110|->     switch (dev->type) {
# 3111|       case VIR_DOMAIN_DEVICE_DISK:
# 3112|           disk = dev->data.disk;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def112]
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:3903:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dev’
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4377:12: enter_function: entry to ‘lxcDomainAttachDeviceFlags’
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4389:5: branch_false: following ‘false’ branch (when ‘__unsuppflags == 0’)...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4392:16: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4392:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4395:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4395:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4398:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4398:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4401:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4401:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4404:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4404:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4405:28: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4405:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4411:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4411:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4418:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4418:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4420:17: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4421:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4424:13: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4424:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4429:20: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4429:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4433:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4433:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4434:44: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4434:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4439:20: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4439:20: call_function: calling ‘lxcDomainAttachDeviceLive’ from ‘lxcDomainAttachDeviceFlags’
# 3901|       int ret = -1;
# 3902|   
# 3903|->     switch (dev->type) {
# 3904|       case VIR_DOMAIN_DEVICE_DISK:
# 3905|           ret = lxcDomainAttachDeviceDiskLive(driver, vm, dev);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def113]
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4328:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dev’
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4537:12: enter_function: entry to ‘lxcDomainDetachDeviceFlags’
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4552:5: branch_false: following ‘false’ branch (when ‘__unsuppflags == 0’)...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4555:16: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4555:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4558:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4558:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4561:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4561:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4564:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4564:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4567:18: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4567:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4570:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4570:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4571:28: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4571:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4576:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4576:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4582:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4582:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4584:17: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4585:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4588:20: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4588:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4592:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4592:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4593:20: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_driver.c:4593:20: call_function: calling ‘lxcDomainDetachDeviceLive’ from ‘lxcDomainDetachDeviceFlags’
# 4326|       int ret = -1;
# 4327|   
# 4328|->     switch (dev->type) {
# 4329|       case VIR_DOMAIN_DEVICE_DISK:
# 4330|           ret = lxcDomainDetachDeviceDiskLive(vm, dev);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def114]
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_fuse.c:208:10: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(hostpath, "r")’
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_fuse.c:203:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_fuse.c:208:10: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_fuse.c:208:10: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_fuse.c:208:10: danger: ‘fopen(hostpath, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  206|       }
#  207|   
#  208|->     fp = fopen(hostpath, "r");
#  209|       if (fp == NULL) {
#  210|           virReportSystemError(errno, _("Cannot open %1$s"), hostpath);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def115]
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_fuse.c:208:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(hostpath, "r")’
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_fuse.c:203:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_fuse.c:208:10: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_fuse.c:208:10: acquire_memory: allocated here
libvirt-11.2.0/redhat-linux-build/../src/lxc/lxc_fuse.c:208:10: danger: ‘fopen(hostpath, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  206|       }
#  207|   
#  208|->     fp = fopen(hostpath, "r");
#  209|       if (fp == NULL) {
#  210|           virReportSystemError(errno, _("Cannot open %1$s"), hostpath);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def116]
libvirt-11.2.0/redhat-linux-build/../src/node_device/node_device_driver.c:1915:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘defs’
libvirt-11.2.0/redhat-linux-build/../src/node_device/node_device_driver.c:1887:1: enter_function: entry to ‘nodeDeviceUpdateMediatedDevices’
libvirt-11.2.0/redhat-linux-build/../src/node_device/node_device_driver.c:1889:35: release_memory: ‘defs’ is NULL
libvirt-11.2.0/redhat-linux-build/../src/node_device/node_device_driver.c:1890:35: release_memory: ‘defs’ is NULL
libvirt-11.2.0/redhat-linux-build/../src/node_device/node_device_driver.c:1897:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/node_device/node_device_driver.c:1902:23: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/node_device/node_device_driver.c:1902:23: call_function: calling ‘virMdevctlList’ from ‘nodeDeviceUpdateMediatedDevices’
libvirt-11.2.0/redhat-linux-build/../src/node_device/node_device_driver.c:1902:23: return_function: returning to ‘nodeDeviceUpdateMediatedDevices’ from ‘virMdevctlList’
libvirt-11.2.0/redhat-linux-build/../src/node_device/node_device_driver.c:1902:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/node_device/node_device_driver.c:1910:5: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/node_device/node_device_driver.c:1910:5: release_memory: ‘defs’ is NULL
libvirt-11.2.0/redhat-linux-build/../src/node_device/node_device_driver.c:1914:17: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/node_device/node_device_driver.c:1915:48: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/node_device/node_device_driver.c:1915:48: release_memory: ‘defs’ is NULL
libvirt-11.2.0/redhat-linux-build/../src/node_device/node_device_driver.c:1915:48: release_memory: ‘defs’ is NULL
libvirt-11.2.0/redhat-linux-build/../src/node_device/node_device_driver.c:1915:13: danger: dereference of NULL ‘defs + i * 8’
# 1913|   
# 1914|       for (i = 0; i < data.ndefs; i++)
# 1915|->         if (nodeDeviceUpdateMediatedDevice(defs[i], true) < 0)
# 1916|               return -1;
# 1917|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def117]
libvirt-11.2.0/redhat-linux-build/../src/nwfilter/nwfilter_dhcpsnoop.c:1727:10: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/run/libvirt/network/nwfilter.leases", "r")’
libvirt-11.2.0/redhat-linux-build/../src/nwfilter/nwfilter_dhcpsnoop.c:1727:10: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../src/nwfilter/nwfilter_dhcpsnoop.c:1727:10: danger: ‘fopen("/run/libvirt/network/nwfilter.leases", "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 1725|       VIR_LOCK_GUARD lock = virLockGuardLock(&virNWFilterSnoopState.snoopLock);
# 1726|   
# 1727|->     fp = fopen(LEASEFILE, "r");
# 1728|       time(&now);
# 1729|       while (fp && fgets(line, sizeof(line), fp)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def118]
libvirt-11.2.0/redhat-linux-build/../src/nwfilter/nwfilter_dhcpsnoop.c:1727:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/run/libvirt/network/nwfilter.leases", "r")’
libvirt-11.2.0/redhat-linux-build/../src/nwfilter/nwfilter_dhcpsnoop.c:1727:10: acquire_memory: allocated here
libvirt-11.2.0/redhat-linux-build/../src/nwfilter/nwfilter_dhcpsnoop.c:1727:10: danger: ‘fopen("/run/libvirt/network/nwfilter.leases", "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
# 1725|       VIR_LOCK_GUARD lock = virLockGuardLock(&virNWFilterSnoopState.snoopLock);
# 1726|   
# 1727|->     fp = fopen(LEASEFILE, "r");
# 1728|       time(&now);
# 1729|       while (fp && fgets(line, sizeof(line), fp)) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def119]
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:550:10: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(conf_file, "r")’
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:550:10: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:550:10: danger: ‘fopen(conf_file, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  548|       temp_file = g_strdup_printf("%s.tmp", conf_file);
#  549|   
#  550|->     fp = fopen(conf_file, "r");
#  551|       if (fp == NULL)
#  552|           goto error;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def120]
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:550:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(conf_file, "r")’
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:550:10: acquire_memory: allocated here
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:550:10: danger: ‘fopen(conf_file, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  548|       temp_file = g_strdup_printf("%s.tmp", conf_file);
#  549|   
#  550|->     fp = fopen(conf_file, "r");
#  551|       if (fp == NULL)
#  552|           goto error;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def121]
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:620:10: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(conf_file, "r")’
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:620:10: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:620:10: danger: ‘fopen(conf_file, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  618|       char *sf, *token, *saveptr = NULL;
#  619|   
#  620|->     fp = fopen(conf_file, "r");
#  621|       if (fp == NULL)
#  622|           return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def122]
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:620:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(conf_file, "r")’
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:620:10: acquire_memory: allocated here
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:620:10: danger: ‘fopen(conf_file, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  618|       char *sf, *token, *saveptr = NULL;
#  619|   
#  620|->     fp = fopen(conf_file, "r");
#  621|       if (fp == NULL)
#  622|           return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def123]
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:682:10: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(from_path, "r")’
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:682:10: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:682:10: danger: ‘fopen(from_path, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  680|       int bytes_read;
#  681|   
#  682|->     fp = fopen(from_path, "r");
#  683|       if (fp == NULL)
#  684|           return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def124]
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:682:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(from_path, "r")’
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:682:10: acquire_memory: allocated here
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:682:10: danger: ‘fopen(from_path, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  680|       int bytes_read;
#  681|   
#  682|->     fp = fopen(from_path, "r");
#  683|       if (fp == NULL)
#  684|           return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def125]
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:822:10: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(conf_file, "r")’
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:819:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:822:10: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:822:10: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:822:10: danger: ‘fopen(conf_file, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  820|           return -1;
#  821|   
#  822|->     fp = fopen(conf_file, "r");
#  823|       if (fp == NULL)
#  824|           goto cleanup;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def126]
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:822:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(conf_file, "r")’
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:819:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:822:10: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:822:10: acquire_memory: allocated here
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:822:10: danger: ‘fopen(conf_file, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#  820|           return -1;
#  821|   
#  822|->     fp = fopen(conf_file, "r");
#  823|       if (fp == NULL)
#  824|           goto cleanup;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def127]
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:876:14: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(conf_file, "a")’
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:866:8: branch_false: following ‘false’ branch (when ‘uuid’ is non-NULL)...
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:869:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:869:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:872:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:872:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:875:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:875:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:876:14: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:876:14: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:876:14: danger: ‘fopen(conf_file, "a")’ leaks here; was opened at [(9)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/8)
#  874|   
#  875|       if (uuidstr[0] == 0) {
#  876|->         fp = fopen(conf_file, "a"); /* append */
#  877|           if (fp == NULL)
#  878|               goto cleanup;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def128]
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:876:14: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(conf_file, "a")’
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:866:8: branch_false: following ‘false’ branch (when ‘uuid’ is non-NULL)...
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:869:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:869:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:872:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:872:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:875:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:875:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:876:14: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:876:14: acquire_memory: allocated here
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_conf.c:876:14: danger: ‘fopen(conf_file, "a")’ leaks here; was allocated at [(9)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/8)
#  874|   
#  875|       if (uuidstr[0] == 0) {
#  876|->         fp = fopen(conf_file, "a"); /* append */
#  877|           if (fp == NULL)
#  878|               goto cleanup;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def129]
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_driver.c:1418:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/proc/vz/vestat", "r")’
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_driver.c:1418:15: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_driver.c:1418:15: danger: ‘fopen("/proc/vz/vestat", "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 1416|   */
# 1417|   
# 1418|->     if ((fp = fopen("/proc/vz/vestat", "r")) == NULL)
# 1419|           return -1;
# 1420|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def130]
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_driver.c:1418:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/proc/vz/vestat", "r")’
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_driver.c:1418:15: acquire_memory: allocated here
libvirt-11.2.0/redhat-linux-build/../src/openvz/openvz_driver.c:1418:15: danger: ‘fopen("/proc/vz/vestat", "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
# 1416|   */
# 1417|   
# 1418|->     if ((fp = fopen("/proc/vz/vestat", "r")) == NULL)
# 1419|           return -1;
# 1420|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def131]
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_block.c:615:19: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_block.c:3696:1: enter_function: entry to ‘qemuBlockCommit’
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_block.c:3710:22: release_memory: ‘backingPath’ is NULL
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_block.c:3710:22: release_memory: ‘backingPath’ is NULL
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_block.c:3710:22: release_memory: ‘backingPath’ is NULL
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_block.c:3715:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_block.c:3718:10: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_block.c:3718:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_block.c:3721:9: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_block.c:3721:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_block.c:3728:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_block.c:3728:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_block.c:3731:22: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_block.c:3733:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_block.c:3746:10: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_block.c:3746:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_block.c:3753:9: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_block.c:3762:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_block.c:3771:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_block.c:3771:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_block.c:3796:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_block.c:3796:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_block.c:3800:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_block.c:3800:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_block.c:3801:13: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_block.c:3801:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_block.c:3805:13: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_block.c:3805:13: call_function: calling ‘qemuBlockReopenReadWrite’ from ‘qemuBlockCommit’
#argument 1 of ‘__builtin_strchr’ must be non-null
#  613|   
#  614|       /* Separate the target and lun */
#  615|->     if ((lunStr = strchr(target, '/'))) {
#  616|           *(lunStr++) = '\0';
#  617|           if (virStrToLong_ui(lunStr, NULL, 10, &lun) < 0) {

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

Error: GCC_ANALYZER_WARNING (CWE-688): [#def133]
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_capabilities.c:5875:9: warning[-Wanalyzer-null-argument]: use of NULL ‘binary’ where non-null expected
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_capabilities.c:5931:1: enter_function: entry to ‘virQEMUCapsNewData’
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_capabilities.c:5936:12: call_function: calling ‘virQEMUCapsNewForBinaryInternal’ from ‘virQEMUCapsNewData’
# 5873|       /* We would also want to check faccessat if we cared about ACLs,
# 5874|        * but we don't.  */
# 5875|->     if (stat(binary, &sb) < 0) {
# 5876|           virReportSystemError(errno, _("Cannot check QEMU binary %1$s"),
# 5877|                                binary);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def134]
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_namespace.c:1205:9: warning[-Wanalyzer-null-argument]: use of NULL ‘file’ where non-null expected
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_namespace.c:1617:1: enter_function: entry to ‘qemuDomainNamespaceSetupMemory’
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_namespace.c:1623:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_namespace.c:1626:9: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_namespace.c:1629:9: call_function: calling ‘qemuNamespaceMknodPaths’ from ‘qemuDomainNamespaceSetupMemory’
# 1203|       item->file = g_strdup(file);
# 1204|   
# 1205|->     if (g_lstat(file, &item->sb) < 0) {
# 1206|           if (errno == ENOENT)
# 1207|               return -2;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def135]
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_namespace.c:1463:41: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mount’
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_namespace.c:1637:1: enter_function: entry to ‘qemuDomainNamespaceTeardownMemory’
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_namespace.c:1642:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_namespace.c:1645:9: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_namespace.c:1648:9: call_function: calling ‘qemuNamespaceUnlinkPaths’ from ‘qemuDomainNamespaceTeardownMemory’
# 1461|               const char *const *devices = (const char *const *)cfg->cgroupDeviceACL;
# 1462|   
# 1463|->             for (mount = devMountsPath; *mount; mount++) {
# 1464|                   if (STREQ(*mount, "/dev"))
# 1465|                       continue;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def136]
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:252:9: warning[-Wanalyzer-null-argument]: use of NULL ‘*caps.path’ where non-null expected
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:354:1: enter_function: entry to ‘virNbdkitCapsNewData’
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:365:12: call_function: calling ‘qemuNbdkitCapsNew’ from ‘virNbdkitCapsNewData’
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:365:12: return_function: returning to ‘virNbdkitCapsNewData’ from ‘qemuNbdkitCapsNew’
libvirt-11.2.0/redhat-linux-build/../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-401): [#def137]
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1263:19: warning[-Wanalyzer-malloc-leak]: leak of ‘nbd_create()’
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1195:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1201:17: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1201:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1206:48: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1204:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1212:13: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1219:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1222:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1234:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1237:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1237:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1243:15: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1243:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1250:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1250:8: branch_false: following ‘false’ branch...
 branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1253:12: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1254:27: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1263:19: acquire_memory: allocated here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1263:19: danger: ‘nbd_create()’ leaks here; was allocated at [(19)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/18)
# 1261|                * provide a useful message to the user.
# 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());

Error: GCC_ANALYZER_WARNING (CWE-688): [#def138]
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1264:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘nbd_create()’ where non-null expected
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1195:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1201:17: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1201:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1206:48: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1204:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1212:13: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1219:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1222:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1234:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1237:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1237:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1243:15: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1243:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1250:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1250:8: branch_false: following ‘false’ branch...
 branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1253:12: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1254:27: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1263:19: acquire_memory: this call could return NULL
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_nbdkit.c:1264:17: danger: argument 1 (‘nbd_create()’) from [(19)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/18) 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): [#def139]
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_validate.c:2887:43: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘((virDomainIothreadMappingDef)*(void *)((void *)ioth)).queues’
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_validate.c:2834:8: branch_false: following ‘false’ branch (when ‘iothreads’ is non-NULL)...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_validate.c:2837:5: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_validate.c:2839:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_validate.c:2858:5: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_validate.c:2858:25: branch_true: following ‘true’ branch (when ‘n’ is non-NULL)...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_validate.c:2859:38: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_validate.c:2863:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_validate.c:2869:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_validate.c:2871:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_validate.c:2878:13: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_validate.c:2878:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_validate.c:2884:21: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_validate.c:2887:43: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_validate.c:2887:43: danger: dereference of NULL ‘*ioth.queues + i * 4’
# 2885|               bool hasMapping;
# 2886|   
# 2887|->             if (virBitmapGetBit(queueMap, ioth->queues[i], &hasMapping) < 0) {
# 2888|                   virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
# 2889|                                  _("iothread queue '%1$u' mapping out of range"),

Error: GCC_ANALYZER_WARNING (CWE-476): [#def140]
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_validate.c:2887:43: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘((virDomainIothreadMappingDef)*(void *)*n.data).queues’
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_validate.c:3659:1: enter_function: entry to ‘qemuValidateCheckSCSIControllerIOThreads’
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_validate.c:3666:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_validate.c:3674:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_validate.c:3674:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_validate.c:3675:14: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_validate.c:3675:12: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_validate.c:3682:47: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_validate.c:3681:13: call_function: calling ‘qemuDomainValidateIothreadMapping’ from ‘qemuValidateCheckSCSIControllerIOThreads’
# 2885|               bool hasMapping;
# 2886|   
# 2887|->             if (virBitmapGetBit(queueMap, ioth->queues[i], &hasMapping) < 0) {
# 2888|                   virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
# 2889|                                  _("iothread queue '%1$u' mapping out of range"),

Error: GCC_ANALYZER_WARNING (CWE-476): [#def141]
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_vhost_user.c:330:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘vu’
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_vhost_user.c:340:1: enter_function: entry to ‘qemuVhostUserFillDomainGPU’
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_vhost_user.c:349:17: call_function: calling ‘qemuVhostUserFetchParsedConfigs’ from ‘qemuVhostUserFillDomainGPU’
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_vhost_user.c:349:17: return_function: returning to ‘qemuVhostUserFillDomainGPU’ from ‘qemuVhostUserFetchParsedConfigs’
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_vhost_user.c:349:8: branch_false: following ‘false’ branch...
 branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_vhost_user.c:353:17: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_vhost_user.c:398:8: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_vhost_user.c:398:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_vhost_user.c:404:10: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_vhost_user.c:404:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_vhost_user.c:407:10: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/qemu/qemu_vhost_user.c:407:8: branch_true: following ‘true’ branch...
 branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../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): [#def142]
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:3392:43: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:3356:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:3359:5: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:3361:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:3365:8: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:3365:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:3369:8: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:3369:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:3371:15: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:3373:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:3379:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:3379:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:3385:5: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:3388:17: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:3390:43: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:3390:43: release_memory: ‘0’ is NULL
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:3392:43: danger: dereference of NULL ‘params + i * 88’
# 3390|           ret->params.params_val[i].field = g_strdup(params[i].field);
# 3391|   
# 3392|->         ret->params.params_val[i].value = params[i].value;
# 3393|       }
# 3394|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def143]
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:3458:43: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:3422:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:3425:5: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:3427:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:3431:8: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:3431:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:3435:8: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:3435:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:3437:15: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:3439:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:3445:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:3445:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:3451:5: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:3454:17: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:3456:43: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:3456:43: release_memory: ‘0’ is NULL
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:3458:43: danger: dereference of NULL ‘params + i * 88’
# 3456|           ret->params.params_val[i].field = g_strdup(params[i].field);
# 3457|   
# 3458|->         ret->params.params_val[i].value = params[i].value;
# 3459|       }
# 3460|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def144]
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:5276:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:5222:1: enter_function: entry to ‘remoteDispatchDomainGetCPUStats’
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:5235:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:5238:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:5238:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:5242:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:5242:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:5247:8: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:5247:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:5250:17: call_function: inlined call to ‘get_nonnull_domain’ from ‘remoteDispatchDomainGetCPUStats’
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:5250:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:5255:39: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:5256:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:5259:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:5272:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:5275:21: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:5276:23: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:5276:23: release_memory: ‘0’ is NULL
libvirt-11.2.0/redhat-linux-build/../src/remote/remote_daemon_dispatch.c:5276:17: danger: dereference of NULL ‘params + i * 96’
# 5274|   
# 5275|           for (i = 0; i < percpu_len; i++) {
# 5276|->             if (params[i].type == VIR_TYPED_PARAM_STRING)
# 5277|                   ret->nparams--;
# 5278|           }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def145]
libvirt-11.2.0/redhat-linux-build/../src/rpc/virnetsocket.c:754:9: warning[-Wanalyzer-null-argument]: use of NULL ‘lockpath’ where non-null expected
libvirt-11.2.0/redhat-linux-build/../src/rpc/virnetsocket.c:659:5: enter_function: entry to ‘virNetSocketNewConnectUNIX’
libvirt-11.2.0/redhat-linux-build/../src/rpc/virnetsocket.c:677:8: branch_false: following ‘false’ branch (when ‘spawnDaemonPath’ is NULL)...
libvirt-11.2.0/redhat-linux-build/../src/rpc/virnetsocket.c:702:15: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/rpc/virnetsocket.c:702:8: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
libvirt-11.2.0/redhat-linux-build/../src/rpc/virnetsocket.c:707:5: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/rpc/virnetsocket.c:708:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/rpc/virnetsocket.c:712:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/rpc/virnetsocket.c:747:22: call_function: calling ‘virNetSocketNew’ from ‘virNetSocketNewConnectUNIX’
libvirt-11.2.0/redhat-linux-build/../src/rpc/virnetsocket.c:747:22: return_function: returning to ‘virNetSocketNewConnectUNIX’ from ‘virNetSocketNew’
libvirt-11.2.0/redhat-linux-build/../src/rpc/virnetsocket.c:747:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/rpc/virnetsocket.c:752:2: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/rpc/virnetsocket.c:753:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/rpc/virnetsocket.c:754:9: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../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): [#def146]
libvirt-11.2.0/redhat-linux-build/../src/rpc/virnetsocket.c:2035:8: 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): [#def147]
libvirt-11.2.0/redhat-linux-build/../src/rpc/virnetsocket.c:2040:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*sock.fd’
libvirt-11.2.0/redhat-linux-build/../src/rpc/virnetsocket.c:2035:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/rpc/virnetsocket.c:2040:5: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../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-688): [#def148]
libvirt-11.2.0/redhat-linux-build/../src/rpc/virnetsshsession.c:223:20: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-11.2.0/redhat-linux-build/../src/rpc/virnetsshsession.c:182:1: enter_function: entry to ‘virNetSSHKbIntCb’
libvirt-11.2.0/redhat-linux-build/../src/rpc/virnetsshsession.c:210:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/rpc/virnetsshsession.c:215:15: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/rpc/virnetsshsession.c:218:17: branch_true: following ‘true’ branch (when ‘i < __n’)...
libvirt-11.2.0/redhat-linux-build/../src/rpc/virnetsshsession.c:219:29: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/rpc/virnetsshsession.c:223:20: danger: argument 1 (‘<unknown>’) NULL where non-null expected
#  221|           /* remove colon and trailing spaces from prompts, as default behavior
#  222|            * of libvirt's auth callback is to add them */
#  223|->         if ((tmp = strrchr(askcred[i].prompt, ':')))
#  224|               *tmp = '\0';
#  225|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def149]
libvirt-11.2.0/redhat-linux-build/../src/security/security_selinux.c:1444:21: warning[-Wanalyzer-null-argument]: use of NULL ‘tcon’ where non-null expected
libvirt-11.2.0/redhat-linux-build/../src/security/security_selinux.c:3745:1: enter_function: entry to ‘virSecuritySELinuxSetTPMLabels’
libvirt-11.2.0/redhat-linux-build/../src/security/security_selinux.c:3754:8: branch_false: following ‘false’ branch...
 branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/security/security_selinux.c:3757:17: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/security/security_selinux.c:3758:13: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/security/security_selinux.c:3758:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/security/security_selinux.c:3761:12: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/security/security_selinux.c:3761:12: branch_true: following ‘true’ branch (when ‘setTPMStateLabel != 0’)...
libvirt-11.2.0/redhat-linux-build/../src/security/security_selinux.c:3763:51: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/security/security_selinux.c:3762:19: call_function: calling ‘virSecuritySELinuxSetFileLabels’ from ‘virSecuritySELinuxSetTPMLabels’
# 1442|                    * @path). However, the refcounter was
# 1443|                    * incremented in XATTRs so decrease it. */
# 1444|->                 if (STRNEQ(econ, tcon)) {
# 1445|                       virReportError(VIR_ERR_OPERATION_INVALID,
# 1446|                                      _("Setting different SELinux label on %1$s which is already in use"),

Error: GCC_ANALYZER_WARNING (CWE-775): [#def150]
libvirt-11.2.0/redhat-linux-build/../src/storage/storage_backend_fs.c:247:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/etc/mtab", "r")’
libvirt-11.2.0/redhat-linux-build/../src/storage/storage_backend_fs.c:247:17: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../src/storage/storage_backend_fs.c:247:17: danger: ‘fopen("/etc/mtab", "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  245|       g_autofree char *src = NULL;
#  246|   
#  247|->     if ((mtab = fopen(_PATH_MOUNTED, "r")) == NULL) {
#  248|           virReportSystemError(errno,
#  249|                                _("cannot read mount list '%1$s'"),

Error: GCC_ANALYZER_WARNING (CWE-401): [#def151]
libvirt-11.2.0/redhat-linux-build/../src/storage/storage_backend_fs.c:247:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/etc/mtab", "r")’
libvirt-11.2.0/redhat-linux-build/../src/storage/storage_backend_fs.c:247:17: acquire_memory: allocated here
libvirt-11.2.0/redhat-linux-build/../src/storage/storage_backend_fs.c:247:17: danger: ‘fopen("/etc/mtab", "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  245|       g_autofree char *src = NULL;
#  246|   
#  247|->     if ((mtab = fopen(_PATH_MOUNTED, "r")) == NULL) {
#  248|           virReportSystemError(errno,
#  249|                                _("cannot read mount list '%1$s'"),

Error: GCC_ANALYZER_WARNING (CWE-688): [#def152]
libvirt-11.2.0/redhat-linux-build/../src/storage/storage_backend_logical.c:431:13: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-11.2.0/redhat-linux-build/../src/storage/storage_backend_logical.c:416:1: enter_function: entry to ‘virStorageBackendLogicalFindPoolSourcesFunc’
libvirt-11.2.0/redhat-linux-build/../src/storage/storage_backend_logical.c:430:17: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/storage/storage_backend_logical.c:431:13: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../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): [#def153]
libvirt-11.2.0/redhat-linux-build/../src/storage/storage_backend_logical.c:587:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘thisSource’
libvirt-11.2.0/redhat-linux-build/../src/storage/storage_backend_logical.c:557:8: branch_false: following ‘false’ branch...
 branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/storage/storage_backend_logical.c:561:17: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/storage/storage_backend_logical.c:567:8: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/storage/storage_backend_logical.c:567:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/storage/storage_backend_logical.c:578:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/storage/storage_backend_logical.c:578:7: branch_false: following ‘false’ branch...
 branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/storage/storage_backend_logical.c:586:17: branch_true: following ‘true’ branch...
 branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../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-688): [#def154]
libvirt-11.2.0/redhat-linux-build/../src/storage/storage_backend_zfs.c:248:16: warning[-Wanalyzer-null-argument]: use of NULL ‘zpool_props’ where non-null expected
libvirt-11.2.0/redhat-linux-build/../src/storage/storage_backend_zfs.c:228:1: enter_function: entry to ‘virStorageBackendZFSRefreshPool’
libvirt-11.2.0/redhat-linux-build/../src/storage/storage_backend_zfs.c:231:11: release_memory: ‘zpool_props’ is NULL
libvirt-11.2.0/redhat-linux-build/../src/storage/storage_backend_zfs.c:248:16: danger: argument 1 (‘<unknown>’) NULL where non-null expected
#argument 1 of ‘__builtin_strchr’ must be non-null
#  246|        * Here we just provide a list of properties we want to see
#  247|        */
#  248|->     if ((tmp = strchr(name, '/')))
#  249|           *tmp = '\0';
#  250|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def155]
libvirt-11.2.0/redhat-linux-build/../src/storage/storage_util.c:2785:15: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-11.2.0/redhat-linux-build/../src/storage/storage_util.c:2774:1: enter_function: entry to ‘virStorageBackendBuildLocal’
libvirt-11.2.0/redhat-linux-build/../src/storage/storage_util.c:2785:15: danger: argument 1 (‘<unknown>’) NULL where non-null expected
# 2783|   
# 2784|       parent = g_strdup(def->target.path);
# 2785|->     if (!(p = strrchr(parent, '/'))) {
# 2786|           virReportError(VIR_ERR_INVALID_ARG,
# 2787|                          _("path '%1$s' is not absolute"),

Error: GCC_ANALYZER_WARNING (CWE-688): [#def156]
libvirt-11.2.0/redhat-linux-build/../src/storage_file/storage_source_backingstore.c:311:24: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-11.2.0/redhat-linux-build/../src/storage_file/storage_source_backingstore.c:291:1: enter_function: entry to ‘virStorageSourceParseNBDColonString’
libvirt-11.2.0/redhat-linux-build/../src/storage_file/storage_source_backingstore.c:311:24: danger: argument 1 (‘<unknown>’) NULL where non-null expected
#argument 1 of ‘__builtin_strstr’ must be non-null
#  309|   
#  310|       /* first look for ':exportname=' and cut it off */
#  311|->     if ((export_name = strstr(nbd, ":exportname="))) {
#  312|           src->path = g_strdup(export_name + strlen(":exportname="));
#  313|           export_name[0] = '\0';

Error: GCC_ANALYZER_WARNING (CWE-476): [#def157]
libvirt-11.2.0/redhat-linux-build/../src/test/test_driver.c:10555:43: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dev’
libvirt-11.2.0/redhat-linux-build/../src/test/test_driver.c:10620:1: enter_function: entry to ‘testDomainUpdateDeviceFlags’
libvirt-11.2.0/redhat-linux-build/../src/test/test_driver.c:10635:5: branch_false: following ‘false’ branch (when ‘__unsuppflags == 0’)...
libvirt-11.2.0/redhat-linux-build/../src/test/test_driver.c:10638:16: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/test/test_driver.c:10638:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/test/test_driver.c:10641:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/test/test_driver.c:10641:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/test/test_driver.c:10644:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/test/test_driver.c:10644:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/test/test_driver.c:10647:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/test/test_driver.c:10652:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/test/test_driver.c:10655:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/test/test_driver.c:10655:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/test/test_driver.c:10661:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/test/test_driver.c:10661:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/test/test_driver.c:10668:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/test/test_driver.c:10668:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/test/test_driver.c:10682:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/test/test_driver.c:10682:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/test/test_driver.c:10685:20: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/test/test_driver.c:10685:20: call_function: calling ‘testDomainUpdateDevice’ from ‘testDomainUpdateDeviceFlags’
#10553|   {
#10554|       virDomainDiskDef *newDisk;
#10555|->     virDomainDeviceDef oldDev = { .type = dev->type };
#10556|       int pos;
#10557|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def158]
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroup.c:353:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(procfile, "r")’
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroup.c:2991:1: enter_function: entry to ‘virCgroupControllerAvailable’
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroup.c:2998:9: call_function: calling ‘virCgroupNew’ from ‘virCgroupControllerAvailable’
#  351|       }
#  352|   
#  353|->     mapping = fopen(procfile, "r");
#  354|       if (mapping == NULL) {
#  355|           virReportSystemError(errno,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def159]
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroup.c:353:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(procfile, "r")’
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroup.c:2991:1: enter_function: entry to ‘virCgroupControllerAvailable’
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroup.c:2998:9: call_function: calling ‘virCgroupNew’ from ‘virCgroupControllerAvailable’
#  351|       }
#  352|   
#  353|->     mapping = fopen(procfile, "r");
#  354|       if (mapping == NULL) {
#  355|           virReportSystemError(errno,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def160]
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroup.c:2672:20: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(keypath, "r")’
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroup.c:2650:1: enter_function: entry to ‘virCgroupKillInternal’
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroup.c:2664:9: call_function: calling ‘virCgroupPathOfController’ from ‘virCgroupKillInternal’
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroup.c:2664:9: return_function: returning to ‘virCgroupKillInternal’ from ‘virCgroupPathOfController’
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroup.c:2664:8: branch_false: following ‘false’ branch...
 branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroup.c:2670:12: branch_false: following ‘false’ branch (when ‘done == 0’)...
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroup.c:2672:20: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroup.c:2672:20: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroup.c:2672:20: danger: ‘fopen(keypath, "r")’ leaks here; was opened at [(13)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/12)
# 2670|       while (!done) {
# 2671|           done = true;
# 2672|->         if (!(fp = fopen(keypath, "r"))) {
# 2673|               if (errno == ENOENT) {
# 2674|                   VIR_DEBUG("No file %s, assuming done", keypath);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def161]
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroup.c:2672:20: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(keypath, "r")’
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroup.c:2650:1: enter_function: entry to ‘virCgroupKillInternal’
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroup.c:2664:9: call_function: calling ‘virCgroupPathOfController’ from ‘virCgroupKillInternal’
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroup.c:2664:9: return_function: returning to ‘virCgroupKillInternal’ from ‘virCgroupPathOfController’
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroup.c:2664:8: branch_false: following ‘false’ branch...
 branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroup.c:2670:12: branch_false: following ‘false’ branch (when ‘done == 0’)...
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroup.c:2672:20: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroup.c:2672:20: acquire_memory: allocated here
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroup.c:2672:20: danger: ‘fopen(keypath, "r")’ leaks here; was allocated at [(13)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/12)
# 2670|       while (!done) {
# 2671|           done = true;
# 2672|->         if (!(fp = fopen(keypath, "r"))) {
# 2673|               if (errno == ENOENT) {
# 2674|                   VIR_DEBUG("No file %s, assuming done", keypath);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def162]
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroupv1.c:230:15: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroupv1.c:219:1: enter_function: entry to ‘virCgroupV1ResolveMountLink’
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroupv1.c:230:15: danger: argument 1 (‘<unknown>’) NULL where non-null expected
#  228|       tmp = g_strdup(mntDir);
#  229|   
#  230|->     dirName = strrchr(tmp, '/');
#  231|       if (!dirName) {
#  232|           virReportError(VIR_ERR_INTERNAL_ERROR,

Error: GCC_ANALYZER_WARNING (CWE-688): [#def163]
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroupv1.c:368:26: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroupv1.c:332:1: enter_function: entry to ‘virCgroupV1DetectPlacement’
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroupv1.c:339:17: branch_true: following ‘true’ branch (when ‘i != 10’)...
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroupv1.c:340:31: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroupv1.c:344:14: call_function: calling ‘virCgroupV1MountOptsMatchController’ from ‘virCgroupV1DetectPlacement’
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroupv1.c:344:14: return_function: returning to ‘virCgroupV1DetectPlacement’ from ‘virCgroupV1MountOptsMatchController’
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroupv1.c:344:12: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroupv1.c:347:14: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroupv1.c:347:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroupv1.c:350:13: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroupv1.c:350:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroupv1.c:355:21: call_function: inlined call to ‘g_strdup_inline’ from ‘virCgroupV1DetectPlacement’
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroupv1.c:365:12: branch_false: following ‘false’ branch (when ‘i != 9’)...
libvirt-11.2.0/redhat-linux-build/../src/util/vircgroupv1.c:368:26: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../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): [#def164]
libvirt-11.2.0/redhat-linux-build/../src/util/virdaemon.c:66:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(stdinfd, 0)’
libvirt-11.2.0/redhat-linux-build/../src/util/virdaemon.c:43:1: enter_function: entry to ‘virDaemonForkIntoBackground’
libvirt-11.2.0/redhat-linux-build/../src/util/virdaemon.c:48:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virdaemon.c:51:11: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virdaemon.c:62:16: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virdaemon.c:64:29: call_function: inlined call to ‘open’ from ‘virDaemonForkIntoBackground’
libvirt-11.2.0/redhat-linux-build/../src/util/virdaemon.c:64:16: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virdaemon.c:66:17: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virdaemon.c:66:17: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../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): [#def165]
libvirt-11.2.0/redhat-linux-build/../src/util/virdaemon.c:68:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(stdoutfd, 1)’
libvirt-11.2.0/redhat-linux-build/../src/util/virdaemon.c:43:1: enter_function: entry to ‘virDaemonForkIntoBackground’
libvirt-11.2.0/redhat-linux-build/../src/util/virdaemon.c:48:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virdaemon.c:51:11: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virdaemon.c:62:16: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virdaemon.c:64:29: call_function: inlined call to ‘open’ from ‘virDaemonForkIntoBackground’
libvirt-11.2.0/redhat-linux-build/../src/util/virdaemon.c:64:16: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virdaemon.c:66:17: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virdaemon.c:66:16: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virdaemon.c:68:17: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virdaemon.c:68:17: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../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): [#def166]
libvirt-11.2.0/redhat-linux-build/../src/util/virdaemon.c:70:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(stdoutfd, 2)’
libvirt-11.2.0/redhat-linux-build/../src/util/virdaemon.c:43:1: enter_function: entry to ‘virDaemonForkIntoBackground’
libvirt-11.2.0/redhat-linux-build/../src/util/virdaemon.c:48:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virdaemon.c:51:11: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virdaemon.c:62:16: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virdaemon.c:64:29: call_function: inlined call to ‘open’ from ‘virDaemonForkIntoBackground’
libvirt-11.2.0/redhat-linux-build/../src/util/virdaemon.c:64:16: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virdaemon.c:66:17: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virdaemon.c:66:16: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virdaemon.c:68:17: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virdaemon.c:68:16: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virdaemon.c:70:17: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virdaemon.c:70:17: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../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-775): [#def167]
libvirt-11.2.0/redhat-linux-build/../src/util/virdnsmasq.c:174:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(g_strdup_printf("%s.new", path), "w")’
libvirt-11.2.0/redhat-linux-build/../src/util/virdnsmasq.c:174:15: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../src/util/virdnsmasq.c:174:15: danger: ‘fopen(g_strdup_printf("%s.new", path), "w")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  172|       tmp = g_strdup_printf("%s.new", path);
#  173|   
#  174|->     if (!(f = fopen(tmp, "w"))) {
#  175|           istmp = false;
#  176|           if (!(f = fopen(path, "w")))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def168]
libvirt-11.2.0/redhat-linux-build/../src/util/virdnsmasq.c:174:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(g_strdup_printf("%s.new", path), "w")’
libvirt-11.2.0/redhat-linux-build/../src/util/virdnsmasq.c:174:15: acquire_memory: allocated here
libvirt-11.2.0/redhat-linux-build/../src/util/virdnsmasq.c:174:15: danger: ‘fopen(g_strdup_printf("%s.new", path), "w")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  172|       tmp = g_strdup_printf("%s.new", path);
#  173|   
#  174|->     if (!(f = fopen(tmp, "w"))) {
#  175|           istmp = false;
#  176|           if (!(f = fopen(path, "w")))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def169]
libvirt-11.2.0/redhat-linux-build/../src/util/virdnsmasq.c:176:19: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "w")’
libvirt-11.2.0/redhat-linux-build/../src/util/virdnsmasq.c:174:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virdnsmasq.c:176:19: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virdnsmasq.c:176:19: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../src/util/virdnsmasq.c:176:19: danger: ‘fopen(path, "w")’ leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  174|       if (!(f = fopen(tmp, "w"))) {
#  175|           istmp = false;
#  176|->         if (!(f = fopen(path, "w")))
#  177|               return -errno;
#  178|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def170]
libvirt-11.2.0/redhat-linux-build/../src/util/virdnsmasq.c:176:19: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "w")’
libvirt-11.2.0/redhat-linux-build/../src/util/virdnsmasq.c:174:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virdnsmasq.c:176:19: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virdnsmasq.c:176:19: acquire_memory: allocated here
libvirt-11.2.0/redhat-linux-build/../src/util/virdnsmasq.c:176:19: danger: ‘fopen(path, "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  174|       if (!(f = fopen(tmp, "w"))) {
#  175|           istmp = false;
#  176|->         if (!(f = fopen(path, "w")))
#  177|               return -errno;
#  178|       }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def171]
libvirt-11.2.0/redhat-linux-build/../src/util/virdnsmasq.c:366:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(g_strdup_printf("%s.new", path), "w")’
libvirt-11.2.0/redhat-linux-build/../src/util/virdnsmasq.c:366:15: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../src/util/virdnsmasq.c:366:15: danger: ‘fopen(g_strdup_printf("%s.new", path), "w")’ leaks here; was opened at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  364|       tmp = g_strdup_printf("%s.new", path);
#  365|   
#  366|->     if (!(f = fopen(tmp, "w"))) {
#  367|           istmp = false;
#  368|           if (!(f = fopen(path, "w")))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def172]
libvirt-11.2.0/redhat-linux-build/../src/util/virdnsmasq.c:366:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(g_strdup_printf("%s.new", path), "w")’
libvirt-11.2.0/redhat-linux-build/../src/util/virdnsmasq.c:366:15: acquire_memory: allocated here
libvirt-11.2.0/redhat-linux-build/../src/util/virdnsmasq.c:366:15: danger: ‘fopen(g_strdup_printf("%s.new", path), "w")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  364|       tmp = g_strdup_printf("%s.new", path);
#  365|   
#  366|->     if (!(f = fopen(tmp, "w"))) {
#  367|           istmp = false;
#  368|           if (!(f = fopen(path, "w")))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def173]
libvirt-11.2.0/redhat-linux-build/../src/util/virdnsmasq.c:368:19: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "w")’
libvirt-11.2.0/redhat-linux-build/../src/util/virdnsmasq.c:366:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virdnsmasq.c:368:19: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virdnsmasq.c:368:19: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../src/util/virdnsmasq.c:368:19: danger: ‘fopen(path, "w")’ leaks here; was opened at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  366|       if (!(f = fopen(tmp, "w"))) {
#  367|           istmp = false;
#  368|->         if (!(f = fopen(path, "w")))
#  369|               return -errno;
#  370|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def174]
libvirt-11.2.0/redhat-linux-build/../src/util/virdnsmasq.c:368:19: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "w")’
libvirt-11.2.0/redhat-linux-build/../src/util/virdnsmasq.c:366:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virdnsmasq.c:368:19: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virdnsmasq.c:368:19: acquire_memory: allocated here
libvirt-11.2.0/redhat-linux-build/../src/util/virdnsmasq.c:368:19: danger: ‘fopen(path, "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#  366|       if (!(f = fopen(tmp, "w"))) {
#  367|           istmp = false;
#  368|->         if (!(f = fopen(path, "w")))
#  369|               return -errno;
#  370|       }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def175]
libvirt-11.2.0/redhat-linux-build/../src/util/virfdstream.c:1341:9: warning[-Wanalyzer-null-argument]: use of NULL ‘path’ where non-null expected
libvirt-11.2.0/redhat-linux-build/../src/util/virfdstream.c:1241:1: enter_function: entry to ‘virFDStreamOpenFileInternal’
libvirt-11.2.0/redhat-linux-build/../src/util/virfdstream.c:1262:14: call_function: inlined call to ‘open’ from ‘virFDStreamOpenFileInternal’
libvirt-11.2.0/redhat-linux-build/../src/util/virfdstream.c:1265:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virfdstream.c:1273:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virfdstream.c:1273:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virfdstream.c:1280:8: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virfdstream.c:1293:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virfdstream.c:1294:12: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virfdstream.c:1297:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virfdstream.c:1304:13: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virfdstream.c:1304:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virfdstream.c:1307:22: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virfdstream.c:1331:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virfdstream.c:1332:9: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virfdstream.c:1340:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virfdstream.c:1341:9: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virfdstream.c:1341:9: danger: argument 1 (‘path’) NULL where non-null expected
# 1339|       VIR_FORCE_CLOSE(pipefds[1]);
# 1340|       if (oflags & O_CREAT)
# 1341|->         unlink(path);
# 1342|       virFDStreamThreadDataFree(threadData);
# 1343|       return -1;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def176]
libvirt-11.2.0/redhat-linux-build/../src/util/virfile.c:3243:14: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-11.2.0/redhat-linux-build/../src/util/virfile.c:3234:1: enter_function: entry to ‘virFileMakeParentPath’
libvirt-11.2.0/redhat-linux-build/../src/util/virfile.c:3243:14: danger: argument 1 (‘<unknown>’) NULL where non-null expected
# 3241|       tmp = g_strdup(path);
# 3242|   
# 3243|->     if ((p = strrchr(tmp, '/')) == NULL) {
# 3244|           errno = EINVAL;
# 3245|           return -1;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def177]
libvirt-11.2.0/redhat-linux-build/../src/util/virfile.c:3370:16: warning[-Wanalyzer-null-argument]: use of NULL ‘path’ where non-null expected
libvirt-11.2.0/redhat-linux-build/../src/util/virfile.c:3359:1: enter_function: entry to ‘virFileSanitizePath’
libvirt-11.2.0/redhat-linux-build/../src/util/virfile.c:3370:16: danger: argument 1 (‘path’) NULL where non-null expected
#argument 1 of ‘__builtin_strstr’ must be non-null
# 3368|       /* don't sanitize URIs - rfc3986 states that two slashes may lead to a
# 3369|        * different resource, thus removing them would possibly change the path */
# 3370|->     if ((uri = strstr(path, "://")) && strchr(path, '/') > uri)
# 3371|           return cleanpath;
# 3372|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def178]
libvirt-11.2.0/redhat-linux-build/../src/util/virfile.c:3586:18: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-11.2.0/redhat-linux-build/../src/util/virfile.c:3574:1: enter_function: entry to ‘virFileIsSharedFSType’
libvirt-11.2.0/redhat-linux-build/../src/util/virfile.c:3586:18: danger: argument 1 (‘<unknown>’) NULL where non-null expected
# 3584|       dirpath = g_strdup(path);
# 3585|   
# 3586|->     statfs_ret = statfs(dirpath, &sb);
# 3587|   
# 3588|       while ((statfs_ret < 0) && (p != dirpath)) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def179]
libvirt-11.2.0/redhat-linux-build/../src/util/virfile.c:3643:9: warning[-Wanalyzer-null-argument]: use of NULL ‘path’ where non-null expected
libvirt-11.2.0/redhat-linux-build/../src/util/virfile.c:3701:1: enter_function: entry to ‘virFileFindHugeTLBFS’
libvirt-11.2.0/redhat-linux-build/../src/util/virfile.c:3712:8: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
 branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virfile.c:3719:12: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virfile.c:3722:13: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virfile.c:3729:9: release_memory: ‘0’ is NULL
libvirt-11.2.0/redhat-linux-build/../src/util/virfile.c:3731:13: call_function: calling ‘virFileGetHugepageSize’ from ‘virFileFindHugeTLBFS’
# 3641|       struct statfs fs;
# 3642|   
# 3643|->     if (statfs(path, &fs) < 0) {
# 3644|           virReportSystemError(errno,
# 3645|                                _("cannot determine filesystem for '%1$s'"),

Error: GCC_ANALYZER_WARNING (CWE-476): [#def180]
libvirt-11.2.0/redhat-linux-build/../src/util/virfirewall.c:549:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘fwCmd’
libvirt-11.2.0/redhat-linux-build/../src/util/virfirewall.c:912:1: enter_function: entry to ‘virFirewallApply’
libvirt-11.2.0/redhat-linux-build/../src/util/virfirewall.c:917:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virfirewall.c:928:17: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virfirewall.c:929:13: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virfirewall.c:929:13: call_function: calling ‘virFirewallApplyGroup’ from ‘virFirewallApply’
#  547|   
#  548|       virBufferAdd(&buf, cmd, -1);
#  549|->     for (i = 0; i < fwCmd->argsLen; i++) {
#  550|           virBufferAddLit(&buf, " ");
#  551|           virBufferAdd(&buf, fwCmd->args[i], -1);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def181]
libvirt-11.2.0/redhat-linux-build/../src/util/virfirewall.c:1012:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
libvirt-11.2.0/redhat-linux-build/../src/util/virfirewall.c:980:1: enter_function: entry to ‘virFirewallNewFromRollback’
libvirt-11.2.0/redhat-linux-build/../src/util/virfirewall.c:986:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virfirewall.c:992:16: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virfirewall.c:997:33: branch_true: following ‘true’ branch (when ‘g != 0’)...
libvirt-11.2.0/redhat-linux-build/../src/util/virfirewall.c:999:35: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virfirewall.c:1001:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virfirewall.c:1004:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virfirewall.c:1004:9: call_function: calling ‘virFirewallStartTransaction’ from ‘virFirewallNewFromRollback’
libvirt-11.2.0/redhat-linux-build/../src/util/virfirewall.c:1004:9: return_function: returning to ‘virFirewallNewFromRollback’ from ‘virFirewallStartTransaction’
libvirt-11.2.0/redhat-linux-build/../src/util/virfirewall.c:1006:36: branch_true: following ‘true’ branch (when ‘r != 0’)...
libvirt-11.2.0/redhat-linux-build/../src/util/virfirewall.c:1008:39: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virfirewall.c:1009:37: call_function: calling ‘virFirewallAddCmdFull’ from ‘virFirewallNewFromRollback’
libvirt-11.2.0/redhat-linux-build/../src/util/virfirewall.c:1009:37: return_function: returning to ‘virFirewallNewFromRollback’ from ‘virFirewallAddCmdFull’
libvirt-11.2.0/redhat-linux-build/../src/util/virfirewall.c:1011:25: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virfirewall.c:1012:17: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virfirewall.c:1012:17: danger: dereference of NULL ‘virFirewallAddCmdFull(virFirewallNew(*original.backend), *origCmd.layer, 0, 0, 0, 0)’
# 1010|   
# 1011|               for (i = 0; i < origCmd->argsLen; i++)
# 1012|->                 ADD_ARG(rbCmd, origCmd->args[i]);
# 1013|           }
# 1014|       }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def182]
libvirt-11.2.0/redhat-linux-build/../src/util/virhostmem.c:286:19: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(meminfo_path, "r")’
libvirt-11.2.0/redhat-linux-build/../src/util/virhostmem.c:253:5: branch_false: following ‘false’ branch (when ‘flags == 0’)...
libvirt-11.2.0/redhat-linux-build/../src/util/virhostmem.c:267:14: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virhostmem.c:286:19: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../src/util/virhostmem.c:286:19: danger: ‘fopen(meminfo_path, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  284|                                              SYSFS_SYSTEM_PATH "/node/node%d/meminfo", cellNum);
#  285|           }
#  286|->         meminfo = fopen(meminfo_path, "r");
#  287|   
#  288|           if (!meminfo) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def183]
libvirt-11.2.0/redhat-linux-build/../src/util/virhostmem.c:286:19: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(meminfo_path, "r")’
libvirt-11.2.0/redhat-linux-build/../src/util/virhostmem.c:253:5: branch_false: following ‘false’ branch (when ‘flags == 0’)...
libvirt-11.2.0/redhat-linux-build/../src/util/virhostmem.c:267:14: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virhostmem.c:286:19: acquire_memory: allocated here
libvirt-11.2.0/redhat-linux-build/../src/util/virhostmem.c:286:19: danger: ‘fopen(meminfo_path, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  284|                                              SYSFS_SYSTEM_PATH "/node/node%d/meminfo", cellNum);
#  285|           }
#  286|->         meminfo = fopen(meminfo_path, "r");
#  287|   
#  288|           if (!meminfo) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def184]
libvirt-11.2.0/redhat-linux-build/../src/util/virlockspace.c:94:17: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-11.2.0/redhat-linux-build/../src/util/virlockspace.c:111:1: enter_function: entry to ‘virLockSpaceResourceNew’
libvirt-11.2.0/redhat-linux-build/../src/util/virlockspace.c:124:5: release_memory: ‘0’ is NULL
libvirt-11.2.0/redhat-linux-build/../src/util/virlockspace.c:126:23: call_function: calling ‘virLockSpaceGetResourcePath’ from ‘virLockSpaceResourceNew’
libvirt-11.2.0/redhat-linux-build/../src/util/virlockspace.c:126:23: return_function: returning to ‘virLockSpaceResourceNew’ from ‘virLockSpaceGetResourcePath’
libvirt-11.2.0/redhat-linux-build/../src/util/virlockspace.c:126:10: release_memory: ‘0’ is NULL
libvirt-11.2.0/redhat-linux-build/../src/util/virlockspace.c:126:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virlockspace.c:127:9: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../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): [#def185]
libvirt-11.2.0/redhat-linux-build/../src/util/virmdev.c:400:48: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dev’
libvirt-11.2.0/redhat-linux-build/../src/util/virmdev.c:419:1: enter_function: entry to ‘virMediatedDeviceListMarkDevices’
libvirt-11.2.0/redhat-linux-build/../src/util/virmdev.c:429:17: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virmdev.c:430:35: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virmdev.c:430:35: call_function: calling ‘virMediatedDeviceListGet’ from ‘virMediatedDeviceListMarkDevices’
libvirt-11.2.0/redhat-linux-build/../src/util/virmdev.c:430:35: return_function: returning to ‘virMediatedDeviceListMarkDevices’ from ‘virMediatedDeviceListGet’
libvirt-11.2.0/redhat-linux-build/../src/util/virmdev.c:430:28: release_memory: ‘mdev’ is NULL
libvirt-11.2.0/redhat-linux-build/../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): [#def186]
libvirt-11.2.0/redhat-linux-build/../src/util/virobject.c:226:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘parent’
libvirt-11.2.0/redhat-linux-build/../src/util/virobject.c:289:1: enter_function: entry to ‘virObjectRWLockableNew’
libvirt-11.2.0/redhat-linux-build/../src/util/virobject.c:293:10: call_function: calling ‘virClassForObjectRWLockable’ from ‘virObjectRWLockableNew’
libvirt-11.2.0/redhat-linux-build/../src/util/virobject.c:293:10: return_function: returning to ‘virObjectRWLockableNew’ from ‘virClassForObjectRWLockable’
libvirt-11.2.0/redhat-linux-build/../src/util/virobject.c:293:10: call_function: calling ‘virClassIsDerivedFrom’ from ‘virObjectRWLockableNew’
#  224|   {
#  225|       while (klass) {
#  226|->         if (klass->magic == parent->magic)
#  227|               return true;
#  228|           klass = klass->parent;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def187]
libvirt-11.2.0/redhat-linux-build/../src/util/virpcivpd.c:181:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘v’
libvirt-11.2.0/redhat-linux-build/../src/util/virpcivpd.c:597:1: enter_function: entry to ‘virPCIVPDParse’
libvirt-11.2.0/redhat-linux-build/../src/util/virpcivpd.c:615:12: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virpcivpd.c:617:13: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virpcivpd.c:617:13: call_function: calling ‘virPCIVPDReadVPDBytes’ from ‘virPCIVPDParse’
libvirt-11.2.0/redhat-linux-build/../src/util/virpcivpd.c:617:13: return_function: returning to ‘virPCIVPDParse’ from ‘virPCIVPDReadVPDBytes’
libvirt-11.2.0/redhat-linux-build/../src/util/virpcivpd.c:617:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virpcivpd.c:621:13: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virpcivpd.c:645:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virpcivpd.c:655:13: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virpcivpd.c:655:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virpcivpd.c:661:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../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): [#def188]
libvirt-11.2.0/redhat-linux-build/../src/util/virrotatingfile.c:183:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-11.2.0/redhat-linux-build/../src/util/virrotatingfile.c:229:1: enter_function: entry to ‘virRotatingFileWriterNew’
libvirt-11.2.0/redhat-linux-build/../src/util/virrotatingfile.c:239:5: release_memory: ‘0’ is NULL
libvirt-11.2.0/redhat-linux-build/../src/util/virrotatingfile.c:241:8: branch_false: following ‘false’ branch (when ‘maxbackup <= 32’)...
libvirt-11.2.0/redhat-linux-build/../src/util/virrotatingfile.c:248:5: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virrotatingfile.c:252:8: branch_true: following ‘true’ branch (when ‘trunc != 0’)...
libvirt-11.2.0/redhat-linux-build/../src/util/virrotatingfile.c:253:9: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../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-457): [#def189]
libvirt-11.2.0/redhat-linux-build/../src/util/virsocketaddr.c:1020:15: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘t2[7]’
libvirt-11.2.0/redhat-linux-build/../src/util/virsocketaddr.c:874:1: enter_function: entry to ‘virSocketAddrGetRange’
libvirt-11.2.0/redhat-linux-build/../src/util/virsocketaddr.c:884:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virsocketaddr.c:890:16: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virsocketaddr.c:890:16: call_function: calling ‘virSocketAddrFormat’ from ‘virSocketAddrGetRange’
libvirt-11.2.0/redhat-linux-build/../src/util/virsocketaddr.c:890:16: return_function: returning to ‘virSocketAddrGetRange’ from ‘virSocketAddrFormat’
libvirt-11.2.0/redhat-linux-build/../src/util/virsocketaddr.c:891:14: call_function: calling ‘virSocketAddrFormat’ from ‘virSocketAddrGetRange’
libvirt-11.2.0/redhat-linux-build/../src/util/virsocketaddr.c:891:14: return_function: returning to ‘virSocketAddrGetRange’ from ‘virSocketAddrFormat’
libvirt-11.2.0/redhat-linux-build/../src/util/virsocketaddr.c:892:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virsocketaddr.c:895:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virsocketaddr.c:902:8: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virsocketaddr.c:902:8: branch_false: following ‘false’ branch (when ‘network’ is NULL)...
libvirt-11.2.0/redhat-linux-build/../src/util/virsocketaddr.c:968:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virsocketaddr.c:968:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virsocketaddr.c:998:15: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virsocketaddr.c:998:15: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virsocketaddr.c:1001:13: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virsocketaddr.c:1001:13: call_function: calling ‘virSocketAddrGetIPv6Addr’ from ‘virSocketAddrGetRange’
libvirt-11.2.0/redhat-linux-build/../src/util/virsocketaddr.c:1001:13: return_function: returning to ‘virSocketAddrGetRange’ from ‘virSocketAddrGetIPv6Addr’
libvirt-11.2.0/redhat-linux-build/../src/util/virsocketaddr.c:1001:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virsocketaddr.c:1002:13: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virsocketaddr.c:1002:13: call_function: calling ‘virSocketAddrGetIPv6Addr’ from ‘virSocketAddrGetRange’
libvirt-11.2.0/redhat-linux-build/../src/util/virsocketaddr.c:1002:13: return_function: returning to ‘virSocketAddrGetRange’ from ‘virSocketAddrGetIPv6Addr’
libvirt-11.2.0/redhat-linux-build/../src/util/virsocketaddr.c:1001:13: branch_false: following ‘false’ branch...
 branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virsocketaddr.c:1012:21: branch_true: following ‘true’ branch (when ‘i != 7’)...
libvirt-11.2.0/redhat-linux-build/../src/util/virsocketaddr.c:1013:17: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virsocketaddr.c:1013:16: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../src/util/virsocketaddr.c:1012:28: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../src/util/virsocketaddr.c:1020:15: danger: use of uninitialized value ‘t2[7]’ here
# 1018|               }
# 1019|           }
# 1020|->         ret = t2[7] - t1[7];
# 1021|           if (ret < 0) {
# 1022|               virReportError(VIR_ERR_INTERNAL_ERROR,

Error: GCC_ANALYZER_WARNING (CWE-688): [#def190]
libvirt-11.2.0/redhat-linux-build/../src/util/virutil.c:1392:11: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-11.2.0/redhat-linux-build/../src/util/virutil.c:1380:1: enter_function: entry to ‘virParseOwnershipIds’
libvirt-11.2.0/redhat-linux-build/../src/util/virutil.c:1392:11: danger: argument 1 (‘<unknown>’) NULL where non-null expected
#argument 1 of ‘__builtin_strchr’ must be non-null
# 1390|   
# 1391|       /* Split label */
# 1392|->     sep = strchr(tmp_label, ':');
# 1393|       if (sep == NULL) {
# 1394|           virReportError(VIR_ERR_INVALID_ARG,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def191]
libvirt-11.2.0/redhat-linux-build/../src/vmware/vmware_conf.c:444:20: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(g_strdup_printf("%s/vmware.log", g_path_get_dirname(vmxPath)), "r")’
libvirt-11.2.0/redhat-linux-build/../src/vmware/vmware_conf.c:444:20: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../src/vmware/vmware_conf.c:444:20: danger: ‘fopen(g_strdup_printf("%s/vmware.log", g_path_get_dirname(vmxPath)), "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  442|       logFilePath = g_strdup_printf("%s/vmware.log", vmxDir);
#  443|   
#  444|->     if ((logFile = fopen(logFilePath, "r")) == NULL)
#  445|           goto cleanup;
#  446|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def192]
libvirt-11.2.0/redhat-linux-build/../src/vmware/vmware_conf.c:444:20: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(g_strdup_printf("%s/vmware.log", g_path_get_dirname(vmxPath)), "r")’
libvirt-11.2.0/redhat-linux-build/../src/vmware/vmware_conf.c:444:20: acquire_memory: allocated here
libvirt-11.2.0/redhat-linux-build/../src/vmware/vmware_conf.c:444:20: danger: ‘fopen(g_strdup_printf("%s/vmware.log", g_path_get_dirname(vmxPath)), "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  442|       logFilePath = g_strdup_printf("%s/vmware.log", vmxDir);
#  443|   
#  444|->     if ((logFile = fopen(logFilePath, "r")) == NULL)
#  445|           goto cleanup;
#  446|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def193]
libvirt-11.2.0/redhat-linux-build/../tests/commandhelper.c:55:1: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
libvirt-11.2.0/redhat-linux-build/../tests/commandhelper.c:346:5: enter_function: entry to ‘main’
libvirt-11.2.0/redhat-linux-build/../tests/commandhelper.c:350:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/commandhelper.c:353:18: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/commandhelper.c:353:18: call_function: calling ‘parseArguments’ from ‘main’
libvirt-11.2.0/redhat-linux-build/../tests/commandhelper.c:353:18: return_function: returning to ‘main’ from ‘parseArguments’
libvirt-11.2.0/redhat-linux-build/../tests/commandhelper.c:55:1: danger: ‘<unknown>’ leaks here; was allocated at [(8)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/7)
#   53|   
#   54|       free(args);
#   55|-> }
#   56|   
#   57|   static void cleanupStringList(char ***ptr)

Error: GCC_ANALYZER_WARNING (CWE-688): [#def194]
libvirt-11.2.0/redhat-linux-build/../tests/commandhelper.c:73:5: warning[-Wanalyzer-null-argument]: use of NULL ‘fopen("/builddir/build/BUILD/libvirt-11.2.0/redhat-linux-build/tests/commandhelper.log", "w")’ where non-null expected
libvirt-11.2.0/redhat-linux-build/../tests/commandhelper.c:350:17: acquire_memory: allocated here
libvirt-11.2.0/redhat-linux-build/../tests/commandhelper.c:350:8: release_memory: assuming ‘fopen("/builddir/build/BUILD/libvirt-11.2.0/redhat-linux-build/tests/commandhelper.log", "w")’ is NULL
libvirt-11.2.0/redhat-linux-build/../tests/commandhelper.c:350:8: branch_true: following ‘true’ branch...
 branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/commandhelper.c:348:34: call_function: inlined call to ‘cleanupFile’ from ‘main’
#   71|   {
#   72|       FILE *file = *ptr;
#   73|->     fclose(file);
#   74|   }
#   75|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def195]
libvirt-11.2.0/redhat-linux-build/../tests/commandhelper.c:73:5: warning[-Wanalyzer-null-argument]: use of NULL ‘log’ where non-null expected
libvirt-11.2.0/redhat-linux-build/../tests/commandhelper.c:348:34: call_function: inlined call to ‘cleanupFile’ from ‘main’
#   71|   {
#   72|       FILE *file = *ptr;
#   73|->     fclose(file);
#   74|   }
#   75|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def196]
libvirt-11.2.0/redhat-linux-build/../tests/commandhelper.c:97:17: warning[-Wanalyzer-malloc-leak]: leak of ‘parseArguments(argc,  argv)’
libvirt-11.2.0/redhat-linux-build/../tests/commandhelper.c:346:5: enter_function: entry to ‘main’
libvirt-11.2.0/redhat-linux-build/../tests/commandhelper.c:350:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/commandhelper.c:353:18: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/commandhelper.c:353:18: call_function: calling ‘parseArguments’ from ‘main’
libvirt-11.2.0/redhat-linux-build/../tests/commandhelper.c:353:18: return_function: returning to ‘main’ from ‘parseArguments’
libvirt-11.2.0/redhat-linux-build/../tests/commandhelper.c:97:17: danger: ‘parseArguments(argc,  argv)’ leaks here; was allocated at [(6)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/5)
#   95|       args->readfds[0] = STDIN_FILENO;
#   96|   
#   97|->     for (i = 1; i < argc; i++) {
#   98|           if (STREQ(argv[i - 1], "--readfd")) {
#   99|               char c;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def197]
libvirt-11.2.0/redhat-linux-build/../tests/commandhelper.c:101:13: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
libvirt-11.2.0/redhat-linux-build/../tests/commandhelper.c:346:5: enter_function: entry to ‘main’
libvirt-11.2.0/redhat-linux-build/../tests/commandhelper.c:350:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/commandhelper.c:353:18: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/commandhelper.c:353:18: call_function: calling ‘parseArguments’ from ‘main’
#   99|               char c;
#  100|   
#  101|->             args->readfds = realloc(args->readfds,
#  102|                                       (args->numreadfds + 1) *
#  103|                                       sizeof(*args->readfds));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def198]
libvirt-11.2.0/redhat-linux-build/../tests/commandhelper.c:350:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/builddir/build/BUILD/libvirt-11.2.0/redhat-linux-build/tests/commandhelper.log", "w")’
libvirt-11.2.0/redhat-linux-build/../tests/commandhelper.c:350:17: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../tests/commandhelper.c:350:17: danger: ‘fopen("/builddir/build/BUILD/libvirt-11.2.0/redhat-linux-build/tests/commandhelper.log", "w")’ leaks here; was opened at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  348|       cleanup(FILE *, cleanupFile) log = NULL;
#  349|   
#  350|->     if (!(log = fopen(abs_builddir "/commandhelper.log", "w")))
#  351|           return EXIT_FAILURE;
#  352|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def199]
libvirt-11.2.0/redhat-linux-build/../tests/commandhelper.c:350:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/builddir/build/BUILD/libvirt-11.2.0/redhat-linux-build/tests/commandhelper.log", "w")’
libvirt-11.2.0/redhat-linux-build/../tests/commandhelper.c:350:17: acquire_memory: allocated here
libvirt-11.2.0/redhat-linux-build/../tests/commandhelper.c:350:17: danger: ‘fopen("/builddir/build/BUILD/libvirt-11.2.0/redhat-linux-build/tests/commandhelper.log", "w")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  348|       cleanup(FILE *, cleanupFile) log = NULL;
#  349|   
#  350|->     if (!(log = fopen(abs_builddir "/commandhelper.log", "w")))
#  351|           return EXIT_FAILURE;
#  352|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def200]
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1261:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(__open_alias("/dev/null", 0), 3)’
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1241:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1244:5: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1261:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1262:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1262:9: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1261:9: danger: ‘dup2(__open_alias("/dev/null", 0), 3)’ leaks here; was opened at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
# 1259|        * want by overwriting any externally inherited fds, then
# 1260|        * initialize, then clear the slots for testing.  */
# 1261|->     if ((fd = open("/dev/null", O_RDONLY)) < 0 ||
# 1262|           dup2(fd, 3) < 0 ||
# 1263|           dup2(fd, 4) < 0 ||

Error: GCC_ANALYZER_WARNING (CWE-775): [#def201]
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1261:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(fd, 4)’
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1241:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1244:5: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1261:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1262:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1261:9: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1263:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1263:9: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1261:9: danger: ‘dup2(fd, 4)’ leaks here; was opened at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
# 1259|        * want by overwriting any externally inherited fds, then
# 1260|        * initialize, then clear the slots for testing.  */
# 1261|->     if ((fd = open("/dev/null", O_RDONLY)) < 0 ||
# 1262|           dup2(fd, 3) < 0 ||
# 1263|           dup2(fd, 4) < 0 ||

Error: GCC_ANALYZER_WARNING (CWE-775): [#def202]
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1261:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(fd, 5)’
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1241:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1244:5: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1261:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1262:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1261:9: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1263:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1261:9: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1264:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1264:9: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1261:9: danger: ‘dup2(fd, 5)’ leaks here; was opened at [(9)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/8)
# 1259|        * want by overwriting any externally inherited fds, then
# 1260|        * initialize, then clear the slots for testing.  */
# 1261|->     if ((fd = open("/dev/null", O_RDONLY)) < 0 ||
# 1262|           dup2(fd, 3) < 0 ||
# 1263|           dup2(fd, 4) < 0 ||

Error: GCC_ANALYZER_WARNING (CWE-775): [#def203]
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1261:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(fd, 6)’
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1241:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1244:5: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1261:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1262:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1261:9: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1263:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1261:9: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1264:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1261:9: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1265:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1265:9: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1261:9: danger: ‘dup2(fd, 6)’ leaks here; was opened at [(11)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/10)
# 1259|        * want by overwriting any externally inherited fds, then
# 1260|        * initialize, then clear the slots for testing.  */
# 1261|->     if ((fd = open("/dev/null", O_RDONLY)) < 0 ||
# 1262|           dup2(fd, 3) < 0 ||
# 1263|           dup2(fd, 4) < 0 ||

Error: GCC_ANALYZER_WARNING (CWE-775): [#def204]
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1261:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(fd, 7)’
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1241:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1244:5: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1261:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1262:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1261:9: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1263:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1261:9: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1264:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1261:9: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1265:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1261:9: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1266:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1266:9: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1261:9: danger: ‘dup2(fd, 7)’ leaks here; was opened at [(13)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/12)
# 1259|        * want by overwriting any externally inherited fds, then
# 1260|        * initialize, then clear the slots for testing.  */
# 1261|->     if ((fd = open("/dev/null", O_RDONLY)) < 0 ||
# 1262|           dup2(fd, 3) < 0 ||
# 1263|           dup2(fd, 4) < 0 ||

Error: GCC_ANALYZER_WARNING (CWE-775): [#def205]
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1261:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(fd, 8)’
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1241:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1244:5: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1261:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1262:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1261:9: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1263:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1261:9: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1264:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1261:9: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1265:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1261:9: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1266:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1261:9: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1267:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1267:9: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../tests/commandtest.c:1261:9: danger: ‘dup2(fd, 8)’ leaks here; was opened at [(15)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/14)
# 1259|        * want by overwriting any externally inherited fds, then
# 1260|        * initialize, then clear the slots for testing.  */
# 1261|->     if ((fd = open("/dev/null", O_RDONLY)) < 0 ||
# 1262|           dup2(fd, 3) < 0 ||
# 1263|           dup2(fd, 4) < 0 ||

Error: GCC_ANALYZER_WARNING (CWE-688): [#def206]
libvirt-11.2.0/redhat-linux-build/../tests/qemudomaincheckpointxml2xmltest.c:92:9: warning[-Wanalyzer-null-argument]: use of NULL ‘outXmlData’ where non-null expected
libvirt-11.2.0/redhat-linux-build/../tests/qemudomaincheckpointxml2xmltest.c:39:22: release_memory: ‘inXmlData’ is NULL
libvirt-11.2.0/redhat-linux-build/../tests/qemudomaincheckpointxml2xmltest.c:40:22: release_memory: ‘inXmlData’ is NULL
libvirt-11.2.0/redhat-linux-build/../tests/qemudomaincheckpointxml2xmltest.c:44:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/qemudomaincheckpointxml2xmltest.c:47:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/qemudomaincheckpointxml2xmltest.c:47:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/qemudomaincheckpointxml2xmltest.c:50:10: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/qemudomaincheckpointxml2xmltest.c:50:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/qemudomaincheckpointxml2xmltest.c:54:17: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/qemudomaincheckpointxml2xmltest.c:54:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/qemudomaincheckpointxml2xmltest.c:61:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/qemudomaincheckpointxml2xmltest.c:61:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/qemudomaincheckpointxml2xmltest.c:66:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/qemudomaincheckpointxml2xmltest.c:66:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/qemudomaincheckpointxml2xmltest.c:81:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/qemudomaincheckpointxml2xmltest.c:87:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/qemudomaincheckpointxml2xmltest.c:92:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/qemudomaincheckpointxml2xmltest.c:92:9: release_memory: ‘outXmlData’ is NULL
libvirt-11.2.0/redhat-linux-build/../tests/qemudomaincheckpointxml2xmltest.c:92:9: danger: argument 1 (‘outXmlData’) NULL where non-null expected
#   90|           return -1;
#   91|   
#   92|->     if (STRNEQ(outXmlData, actual)) {
#   93|           virTestDifferenceFull(stderr, outXmlData, outxml, actual, inxml);
#   94|           return -1;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def207]
libvirt-11.2.0/redhat-linux-build/../tests/qemunbdkittest.c:168:1: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
libvirt-11.2.0/redhat-linux-build/../tests/qemunbdkittest.c:153:5: acquire_resource: ‘va_start’ called here
libvirt-11.2.0/redhat-linux-build/../tests/qemunbdkittest.c:168:1: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  166|           }
#  167|       }
#  168|-> }
#  169|   
#  170|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def208]
libvirt-11.2.0/redhat-linux-build/../tests/securityselinuxlabeltest.c:107:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(g_strdup_printf("%s/securityselinuxlabeldata/%s.txt", "/builddir/build/BUILD/libvirt-11.2.0/tests", testname), "r")’
libvirt-11.2.0/redhat-linux-build/../tests/securityselinuxlabeltest.c:107:16: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../tests/securityselinuxlabeltest.c:107:16: danger: ‘fopen(g_strdup_printf("%s/securityselinuxlabeldata/%s.txt", "/builddir/build/BUILD/libvirt-11.2.0/tests", testname), "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  105|                              testname);
#  106|   
#  107|->     if (!(fp = fopen(path, "r")))
#  108|           return -1;
#  109|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def209]
libvirt-11.2.0/redhat-linux-build/../tests/securityselinuxlabeltest.c:107:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(g_strdup_printf("%s/securityselinuxlabeldata/%s.txt", "/builddir/build/BUILD/libvirt-11.2.0/tests", testname), "r")’
libvirt-11.2.0/redhat-linux-build/../tests/securityselinuxlabeltest.c:107:16: acquire_memory: allocated here
libvirt-11.2.0/redhat-linux-build/../tests/securityselinuxlabeltest.c:107:16: danger: ‘fopen(g_strdup_printf("%s/securityselinuxlabeldata/%s.txt", "/builddir/build/BUILD/libvirt-11.2.0/tests", testname), "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  105|                              testname);
#  106|   
#  107|->     if (!(fp = fopen(path, "r")))
#  108|           return -1;
#  109|   

Error: GCC_ANALYZER_WARNING (CWE-127): [#def210]
libvirt-11.2.0/redhat-linux-build/../tests/testutils.c:413:30: warning[-Wanalyzer-out-of-bounds]: buffer under-read
libvirt-11.2.0/redhat-linux-build/../tests/testutils.c:578:1: enter_function: entry to ‘virTestCompareToFileFull’
libvirt-11.2.0/redhat-linux-build/../tests/testutils.c:590:8: branch_true: following ‘true’ branch (when ‘unwrap != 0’)...
libvirt-11.2.0/redhat-linux-build/../tests/testutils.c:591:13: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/testutils.c:591:13: call_function: calling ‘virTestLoadFile’ from ‘virTestCompareToFileFull’
libvirt-11.2.0/redhat-linux-build/../tests/testutils.c:591:13: return_function: returning to ‘virTestCompareToFileFull’ from ‘virTestLoadFile’
libvirt-11.2.0/redhat-linux-build/../tests/testutils.c:591:12: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/testutils.c:591:61: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/testutils.c:591:13: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/testutils.c:598:21: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/testutils.c:600:8: branch_true: following ‘true’ branch (when ‘cmpcontentLen != 0’)...
libvirt-11.2.0/redhat-linux-build/../tests/testutils.c:601:19: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/testutils.c:600:9: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/testutils.c:602:24: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/testutils.c:606:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/testutils.c:607:9: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/testutils.c:607:9: call_function: calling ‘virTestDifferenceFullInternal’ from ‘virTestCompareToFileFull’
#  411|           while (actualEnd > actualStart &&
#  412|                  expectEnd > expectStart &&
#  413|->                *actualEnd == *expectEnd) {
#  414|               actualEnd--;
#  415|               expectEnd--;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def211]
libvirt-11.2.0/redhat-linux-build/../tests/testutilsqemu.c:733:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup(fakefd)’
libvirt-11.2.0/redhat-linux-build/../tests/testutilsqemu.c:651:12: branch_true: following ‘true’ branch (when ‘argname != 491’)...
libvirt-11.2.0/redhat-linux-build/../tests/testutilsqemu.c:652:9: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/testutilsqemu.c:725:25: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/testutilsqemu.c:726:35: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/testutilsqemu.c:728:20: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/testutilsqemu.c:733:36: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/testutilsqemu.c:733:36: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../tests/testutilsqemu.c:733:20: danger: ‘dup(fakefd)’ leaks here; was opened at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#  731|                   }
#  732|   
#  733|->                 if ((new->fds[i] = dup(fakefd)) < 0) {
#  734|                       fprintf(stderr, "failed to duplicate fake fd: %s",
#  735|                               g_strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-688): [#def212]
libvirt-11.2.0/redhat-linux-build/../tests/testutilsqemu.c:820:14: warning[-Wanalyzer-null-argument]: use of NULL ‘capsfile’ where non-null expected
libvirt-11.2.0/redhat-linux-build/../tests/testutilsqemu.c:778:1: enter_function: entry to ‘testQemuGetRealCapsInternal’
libvirt-11.2.0/redhat-linux-build/../tests/testutilsqemu.c:790:8: branch_true: following ‘true’ branch (when the strings are equal)...
libvirt-11.2.0/redhat-linux-build/../tests/testutilsqemu.c:791:40: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/testutilsqemu.c:794:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/testutilsqemu.c:799:20: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/testutilsqemu.c:820:14: danger: argument 1 (‘capsfile’) NULL where non-null expected
#argument 1 of ‘__builtin_strlen’ must be non-null
#  818|   
#  819|       /* strip 'xml' suffix so that we can format the file to '.replies' */
#  820|->     capsfile[strlen(capsfile) - 3] = '\0';
#  821|   
#  822|       if (schemaCache && schema) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def213]
libvirt-11.2.0/redhat-linux-build/../tests/virhostcputest.c:36:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(cpuinfofile, "r")’
libvirt-11.2.0/redhat-linux-build/../tests/virhostcputest.c:36:15: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../tests/virhostcputest.c:36:15: danger: ‘fopen(cpuinfofile, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   34|       g_autoptr(FILE) cpuinfo = NULL;
#   35|   
#   36|->     cpuinfo = fopen(cpuinfofile, "r");
#   37|       if (!cpuinfo) {
#   38|           fprintf(stderr, "unable to open: %s : %s\n",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def214]
libvirt-11.2.0/redhat-linux-build/../tests/virhostcputest.c:36:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(cpuinfofile, "r")’
libvirt-11.2.0/redhat-linux-build/../tests/virhostcputest.c:36:15: acquire_memory: allocated here
libvirt-11.2.0/redhat-linux-build/../tests/virhostcputest.c:36:15: danger: ‘fopen(cpuinfofile, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   34|       g_autoptr(FILE) cpuinfo = NULL;
#   35|   
#   36|->     cpuinfo = fopen(cpuinfofile, "r");
#   37|       if (!cpuinfo) {
#   38|           fprintf(stderr, "unable to open: %s : %s\n",

Error: GCC_ANALYZER_WARNING (CWE-775): [#def215]
libvirt-11.2.0/redhat-linux-build/../tests/virhostcputest.c:110:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(cpustatfile, "r")’
libvirt-11.2.0/redhat-linux-build/../tests/virhostcputest.c:110:21: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../tests/virhostcputest.c:110:21: danger: ‘fopen(cpustatfile, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  108|       int nparams = 0;
#  109|   
#  110|->     if (!(cpustat = fopen(cpustatfile, "r"))) {
#  111|           virReportSystemError(errno, "failed to open '%s': ", cpustatfile);
#  112|           goto fail;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def216]
libvirt-11.2.0/redhat-linux-build/../tests/virhostcputest.c:110:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(cpustatfile, "r")’
libvirt-11.2.0/redhat-linux-build/../tests/virhostcputest.c:110:21: acquire_memory: allocated here
libvirt-11.2.0/redhat-linux-build/../tests/virhostcputest.c:110:21: danger: ‘fopen(cpustatfile, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  108|       int nparams = 0;
#  109|   
#  110|->     if (!(cpustat = fopen(cpustatfile, "r"))) {
#  111|           virReportSystemError(errno, "failed to open '%s': ", cpustatfile);
#  112|           goto fail;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def217]
libvirt-11.2.0/redhat-linux-build/../tests/virhostcputest.c:193:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(g_strdup_printf("%s/virhostcpudata/linux-%s-%s.cpuinfo", "/builddir/build/BUILD/libvirt-11.2.0/tests", virArchToString(*(const struct linuxTestHostCPUData *)opaque.arch), *(const struct linuxTestHostCPUData *)opaque.testName), "r")’
libvirt-11.2.0/redhat-linux-build/../tests/virhostcputest.c:193:15: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../tests/virhostcputest.c:193:15: danger: ‘fopen(g_strdup_printf("%s/virhostcpudata/linux-%s-%s.cpuinfo", "/builddir/build/BUILD/libvirt-11.2.0/tests", virArchToString(*(const struct linuxTestHostCPUData *)opaque.arch), *(const struct linuxTestHostCPUData *)opaque.testName), "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  191|                                  abs_srcdir, arch, data->testName);
#  192|   
#  193|->     if (!(f = fopen(cpuinfo, "r"))) {
#  194|           virReportSystemError(errno,
#  195|                                "Failed to open cpuinfo file '%s'", cpuinfo);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def218]
libvirt-11.2.0/redhat-linux-build/../tests/virhostcputest.c:193:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(g_strdup_printf("%s/virhostcpudata/linux-%s-%s.cpuinfo", "/builddir/build/BUILD/libvirt-11.2.0/tests", virArchToString(*(const struct linuxTestHostCPUData *)opaque.arch), *(const struct linuxTestHostCPUData *)opaque.testName), "r")’
libvirt-11.2.0/redhat-linux-build/../tests/virhostcputest.c:193:15: acquire_memory: allocated here
libvirt-11.2.0/redhat-linux-build/../tests/virhostcputest.c:193:15: danger: ‘fopen(g_strdup_printf("%s/virhostcpudata/linux-%s-%s.cpuinfo", "/builddir/build/BUILD/libvirt-11.2.0/tests", virArchToString(*(const struct linuxTestHostCPUData *)opaque.arch), *(const struct linuxTestHostCPUData *)opaque.testName), "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  191|                                  abs_srcdir, arch, data->testName);
#  192|   
#  193|->     if (!(f = fopen(cpuinfo, "r"))) {
#  194|           virReportSystemError(errno,
#  195|                                "Failed to open cpuinfo file '%s'", cpuinfo);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def219]
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:293:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(fdserver[0], 100)’
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:277:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:283:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:283:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:293:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:293:9: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:293:8: danger: ‘dup2(fdserver[0], 100)’ leaks here; was opened at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  291|        * fairly reasonable in general
#  292|        */
#  293|->     if (dup2(fdserver[0], 100) < 0 ||
#  294|           dup2(fdserver[1], 101) < 0 ||
#  295|           dup2(fdclient[0], 102) < 0 ||

Error: GCC_ANALYZER_WARNING (CWE-775): [#def220]
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:293:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(fdclient[0], 102)’
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:277:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:283:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:283:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:293:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:293:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:294:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:293:9: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:295:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:295:9: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:293:9: danger: ‘dup2(fdclient[0], 102)’ leaks here; was opened at [(9)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/8)
#  291|        * fairly reasonable in general
#  292|        */
#  293|->     if (dup2(fdserver[0], 100) < 0 ||
#  294|           dup2(fdserver[1], 101) < 0 ||
#  295|           dup2(fdclient[0], 102) < 0 ||

Error: GCC_ANALYZER_WARNING (CWE-775): [#def221]
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:293:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(fdclient[1], 103)’
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:277:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:283:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:283:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:293:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:293:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:294:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:293:9: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:295:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:293:9: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:296:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:296:9: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:293:9: danger: ‘dup2(fdclient[1], 103)’ leaks here; was opened at [(11)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/10)
#  291|        * fairly reasonable in general
#  292|        */
#  293|->     if (dup2(fdserver[0], 100) < 0 ||
#  294|           dup2(fdserver[1], 101) < 0 ||
#  295|           dup2(fdclient[0], 102) < 0 ||

Error: GCC_ANALYZER_WARNING (CWE-775): [#def222]
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:293:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(fdserver[1], 101)’
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:277:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:283:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:283:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:293:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:293:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:294:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:294:9: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../tests/virnetdaemontest.c:293:9: danger: ‘dup2(fdserver[1], 101)’ leaks here; was opened at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  291|        * fairly reasonable in general
#  292|        */
#  293|->     if (dup2(fdserver[0], 100) < 0 ||
#  294|           dup2(fdserver[1], 101) < 0 ||
#  295|           dup2(fdclient[0], 102) < 0 ||

Error: GCC_ANALYZER_WARNING (CWE-688): [#def223]
libvirt-11.2.0/redhat-linux-build/../tests/virnetdevopenvswitchtest.c:133:23: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-11.2.0/redhat-linux-build/../tests/virnetdevopenvswitchtest.c:124:1: enter_function: entry to ‘testNameEscape’
libvirt-11.2.0/redhat-linux-build/../tests/virnetdevopenvswitchtest.c:132:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/virnetdevopenvswitchtest.c:133:12: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/virnetdevopenvswitchtest.c:133:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tests/virnetdevopenvswitchtest.c:133:23: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tests/virnetdevopenvswitchtest.c:133:23: danger: argument 1 (‘<unknown>’) NULL where non-null expected
#  131|   
#  132|       if (data->expect) {
#  133|->         if (rv < 0 || STRNEQ(reply, data->expect)) {
#  134|               fprintf(stderr,
#  135|                       "Unexpected failure, expected: %s for input %s got %s\n",

Error: GCC_ANALYZER_WARNING (CWE-476): [#def224]
libvirt-11.2.0/redhat-linux-build/../tools/virsh-completer-checkpoint.c:69:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
libvirt-11.2.0/redhat-linux-build/../tools/virsh-completer-checkpoint.c:39:5: branch_false: following ‘false’ branch (when ‘flags == 0’)...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-completer-checkpoint.c:41:10: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-completer-checkpoint.c:41:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-completer-checkpoint.c:44:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-completer-checkpoint.c:47:25: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-completer-checkpoint.c:47:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-completer-checkpoint.c:49:9: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-completer-checkpoint.c:68:17: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-completer-checkpoint.c:69:19: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-completer-checkpoint.c:69:19: release_memory: ‘0’ is NULL
libvirt-11.2.0/redhat-linux-build/../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): [#def225]
libvirt-11.2.0/redhat-linux-build/../tools/virsh-domain-monitor.c:1709:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘_pp’
libvirt-11.2.0/redhat-linux-build/../tools/virsh-domain-monitor.c:1511:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-domain-monitor.c:1518:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-domain-monitor.c:1518:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-domain-monitor.c:1548:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-domain-monitor.c:1553:12: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-domain-monitor.c:1553:12: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-domain-monitor.c:1554:19: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-domain-monitor.c:1708:17: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-domain-monitor.c:1709:9: release_memory: ‘_pp’ is NULL
libvirt-11.2.0/redhat-linux-build/../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-688): [#def226]
libvirt-11.2.0/redhat-linux-build/../tools/virsh-domain.c:125:15: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-11.2.0/redhat-linux-build/../tools/virsh-domain.c:120:1: enter_function: entry to ‘virshAddressParse’
libvirt-11.2.0/redhat-linux-build/../tools/virsh-domain.c:125:15: danger: argument 1 (‘<unknown>’) NULL where non-null expected
#argument 1 of ‘__builtin_strchr’ must be non-null
#  123|   {
#  124|       g_autofree char *type = g_strdup(str);
#  125|->     char *a = strchr(type, ':');
#  126|   
#  127|       if (!a)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def227]
libvirt-11.2.0/redhat-linux-build/../tools/virsh-domain.c:9120:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘signame’
libvirt-11.2.0/redhat-linux-build/../tools/virsh-domain.c:9113:12: enter_function: entry to ‘getSignalNumber’
libvirt-11.2.0/redhat-linux-build/../tools/virsh-domain.c:9120:17: danger: dereference of NULL ‘signame + i’
# 9118|       char *p = str;
# 9119|   
# 9120|->     for (i = 0; signame[i]; i++)
# 9121|           p[i] = g_ascii_tolower(signame[i]);
# 9122|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def228]
libvirt-11.2.0/redhat-linux-build/../tools/virsh-interface.c:295:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘_pp’
libvirt-11.2.0/redhat-linux-build/../tools/virsh-interface.c:294:17: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-interface.c:295:9: release_memory: ‘_pp’ is NULL
libvirt-11.2.0/redhat-linux-build/../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): [#def229]
libvirt-11.2.0/redhat-linux-build/../tools/virsh-interface.c:298:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘_pp’
libvirt-11.2.0/redhat-linux-build/../tools/virsh-interface.c:194:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-interface.c:202:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-interface.c:202:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-interface.c:214:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-interface.c:215:25: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-interface.c:216:12: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-interface.c:220:12: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-interface.c:220:12: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-interface.c:221:27: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-interface.c:297:17: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-interface.c:298:9: release_memory: ‘_pp’ is NULL
libvirt-11.2.0/redhat-linux-build/../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): [#def230]
libvirt-11.2.0/redhat-linux-build/../tools/virsh-nodedev.c:343:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘_pp’
libvirt-11.2.0/redhat-linux-build/../tools/virsh-nodedev.c:251:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-nodedev.c:252:9: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-nodedev.c:342:17: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-nodedev.c:343:9: release_memory: ‘names’ is NULL
libvirt-11.2.0/redhat-linux-build/../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): [#def231]
libvirt-11.2.0/redhat-linux-build/../tools/virsh-nwfilter.c:327:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘_pp’
libvirt-11.2.0/redhat-linux-build/../tools/virsh-nwfilter.c:283:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-nwfilter.c:284:9: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-nwfilter.c:326:17: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-nwfilter.c:327:9: release_memory: ‘_pp’ is NULL
libvirt-11.2.0/redhat-linux-build/../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): [#def232]
libvirt-11.2.0/redhat-linux-build/../tools/virsh-secret.c:240:22: warning[-Wanalyzer-null-argument]: use of NULL ‘secret_val’ where non-null expected
libvirt-11.2.0/redhat-linux-build/../tools/virsh-secret.c:210:1: enter_function: entry to ‘cmdSecretSetValue’
libvirt-11.2.0/redhat-linux-build/../tools/virsh-secret.c:215:22: release_memory: ‘secret_val’ is NULL
libvirt-11.2.0/redhat-linux-build/../tools/virsh-secret.c:227:20: call_function: calling ‘virshCommandOptSecret’ from ‘cmdSecretSetValue’
libvirt-11.2.0/redhat-linux-build/../tools/virsh-secret.c:227:20: return_function: returning to ‘cmdSecretSetValue’ from ‘virshCommandOptSecret’
libvirt-11.2.0/redhat-linux-build/../tools/virsh-secret.c:227:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-secret.c:230:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-secret.c:230:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-secret.c:233:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-secret.c:233:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-secret.c:236:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-secret.c:236:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-secret.c:238:9: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-secret.c:240:22: danger: argument 1 (‘<unknown>’) NULL where non-null expected
#argument 1 of ‘__builtin_strlen’ must be non-null
#  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): [#def233]
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1381:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘volInfoTexts’
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1325:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1328:18: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1328:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1331:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1331:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1335:5: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1335:17: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1374:8: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1374:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1376:17: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1377:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1380:21: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1383:47: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1383:47: release_memory: ‘volInfoTexts’ is NULL
libvirt-11.2.0/redhat-linux-build/../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): [#def234]
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1404:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘volInfoTexts’
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1325:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1328:18: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1328:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1331:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1331:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1335:5: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1335:17: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1374:8: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1374:8: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1398:13: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1399:8: branch_false: following ‘false’ branch...
 branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1403:17: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1409:43: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1409:43: release_memory: ‘volInfoTexts’ is NULL
libvirt-11.2.0/redhat-linux-build/../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): [#def235]
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1425:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘volInfoTexts’
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1325:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1328:18: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1328:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1331:9: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1331:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1335:5: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1335:17: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1374:8: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1377:12: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1378:13: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1422:9: branch_true: following ‘true’ branch...
 branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1423:21: branch_true: following ‘true’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1425:13: branch_true: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/virsh-volume.c:1425:13: release_memory: ‘volInfoTexts’ is NULL
libvirt-11.2.0/redhat-linux-build/../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);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def236]
libvirt-11.2.0/redhat-linux-build/../tools/virt-host-validate-common.c:112:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/proc/cpuinfo", "r")’
libvirt-11.2.0/redhat-linux-build/../tools/virt-host-validate-common.c:112:16: acquire_resource: opened here
libvirt-11.2.0/redhat-linux-build/../tools/virt-host-validate-common.c:112:16: danger: ‘fopen("/proc/cpuinfo", "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  110|       size_t linelen = 0;
#  111|   
#  112|->     if (!(fp = fopen("/proc/cpuinfo", "r")))
#  113|           return NULL;
#  114|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def237]
libvirt-11.2.0/redhat-linux-build/../tools/virt-host-validate-common.c:112:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/proc/cpuinfo", "r")’
libvirt-11.2.0/redhat-linux-build/../tools/virt-host-validate-common.c:112:16: acquire_memory: allocated here
libvirt-11.2.0/redhat-linux-build/../tools/virt-host-validate-common.c:112:16: danger: ‘fopen("/proc/cpuinfo", "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  110|       size_t linelen = 0;
#  111|   
#  112|->     if (!(fp = fopen("/proc/cpuinfo", "r")))
#  113|           return NULL;
#  114|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def238]
libvirt-11.2.0/redhat-linux-build/../tools/vsh.c:1283:10: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘opt’
libvirt-11.2.0/redhat-linux-build/../tools/vsh.c:3524:1: enter_function: entry to ‘cmdComplete’
libvirt-11.2.0/redhat-linux-build/../tools/vsh.c:3534:17: call_function: calling ‘vshCommandOptArgv’ from ‘cmdComplete’
libvirt-11.2.0/redhat-linux-build/../tools/vsh.c:3534:17: return_function: returning to ‘cmdComplete’ from ‘vshCommandOptArgv’
libvirt-11.2.0/redhat-linux-build/../tools/vsh.c:3534:51: branch_false: following ‘false’ branch (when ‘args’ is NULL)...
libvirt-11.2.0/redhat-linux-build/../tools/vsh.c:3540:10: branch_false: ...to here
libvirt-11.2.0/redhat-linux-build/../tools/vsh.c:3545:8: branch_false: following ‘false’ branch...
libvirt-11.2.0/redhat-linux-build/../tools/vsh.c:3551:28: call_function: calling ‘vshCommandOptArgvString’ from ‘cmdComplete’
# 1281|           return NULL;
# 1282|   
# 1283|->     if (!opt->argvstr)
# 1284|           opt->argvstr = g_strjoinv(" ", opt->argv);
# 1285|   

Scan Properties

analyzer-version-clippy1.86.0
analyzer-version-cppcheck2.17.1
analyzer-version-gcc15.0.1
analyzer-version-gcc-analyzer15.0.1
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-250.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250425.124705.g1c7c448.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namelibvirt-11.2.0-1.fc43
store-results-to/tmp/tmp1qxhibt3/libvirt-11.2.0-1.fc43.tar.xz
time-created2025-04-25 14:33:49
time-finished2025-04-25 14:45:40
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,cppcheck,gcc,clippy,shellcheck' '-o' '/tmp/tmp1qxhibt3/libvirt-11.2.0-1.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp1qxhibt3/libvirt-11.2.0-1.fc43.src.rpm'
tool-versioncsmock-3.8.1.20250422.172604.g26bc3d6-1.el9