libvirt-10.9.0-1.fc42

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-10.9.0-build/libvirt-10.9.0/examples/c/misc/event-test.c: scope_hint: In function ‘stop’
libvirt-10.9.0-build/libvirt-10.9.0/examples/c/misc/event-test.c:1119:5: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘printf’ from within signal handler
# 1117|   stop(int sig)
# 1118|   {
# 1119|->     printf("Exiting on signal %d\n", sig);
# 1120|       run = 0;
# 1121|   }

Error: GCC_ANALYZER_WARNING (CWE-465): [#def83]
libvirt-10.9.0-build/libvirt-10.9.0/src/conf/virstorageobj.c: scope_hint: In function ‘virStoragePoolObjSourceMatchTypeDEVICE’
libvirt-10.9.0-build/libvirt-10.9.0/src/conf/virstorageobj.c:1358:12: warning[-Wanalyzer-deref-before-check]: check of ‘obj’ for NULL after already dereferencing it
# 1356|               return NULL;
# 1357|   
# 1358|->         if ((matchobj = virStoragePoolSourceFindDuplicateDevices(obj, def))) {
# 1359|               if (!virStoragePoolSourceISCSIMatch(matchobj, def))
# 1360|                   return NULL;

Error: GCC_ANALYZER_WARNING (CWE-465): [#def84]
libvirt-10.9.0-build/libvirt-10.9.0/src/conf/virstorageobj.c: scope_hint: In function ‘virStoragePoolObjSourceFindDuplicateCb’
libvirt-10.9.0-build/libvirt-10.9.0/src/conf/virstorageobj.c:1397:47: warning[-Wanalyzer-deref-before-check]: check of ‘payload’ for NULL after already dereferencing it
libvirt-10.9.0-build/libvirt-10.9.0/src/datatypes.h:24: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/conf/virstorageobj.c:23: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:90:29: note: in definition of macro ‘STREQ’
# 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): [#def85]
libvirt-10.9.0-build/libvirt-10.9.0/src/conf/virstorageobj.c:1403:47: warning[-Wanalyzer-deref-before-check]: check of ‘payload’ for NULL after already dereferencing it
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:90:29: note: in definition of macro ‘STREQ’
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:90:32: note: in definition of macro ‘STREQ’
# 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): [#def86]
libvirt-10.9.0-build/libvirt-10.9.0/src/conf/virstorageobj.c:1417:55: warning[-Wanalyzer-deref-before-check]: check of ‘payload’ for NULL after already dereferencing it
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:90:29: note: in definition of macro ‘STREQ’
# 1415|                data->def->type == VIR_STORAGE_POOL_LOGICAL ||
# 1416|                data->def->type == VIR_STORAGE_POOL_DISK ||
# 1417|->              data->def->type == VIR_STORAGE_POOL_ZFS) &&
# 1418|               virStoragePoolObjSourceMatchTypeDEVICE(obj, data->def))
# 1419|               return 1;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def87]
libvirt-10.9.0-build/libvirt-10.9.0/src/esx/esx_driver.c: scope_hint: In function ‘esxConnectListAllDomains’
libvirt-10.9.0-build/libvirt-10.9.0/src/esx/esx_driver.c:4812:27: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘powerState’
libvirt-10.9.0-build/libvirt-10.9.0/src/esx/esx_driver.c:26: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/esx/esx_driver.c:4716:5: note: in expansion of macro ‘virCheckFlags’
libvirt-10.9.0-build/libvirt-10.9.0/src/esx/esx_driver.c:4737:9: note: in expansion of macro ‘MATCH’
libvirt-10.9.0-build/libvirt-10.9.0/src/esx/esx_driver.c:4751:20: note: in expansion of macro ‘MATCH’
libvirt-10.9.0-build/libvirt-10.9.0/src/esx/esx_driver.c:4810:13: note: in expansion of macro ‘MATCH’
libvirt-10.9.0-build/libvirt-10.9.0/src/esx/esx_driver.c:4811:16: note: in expansion of macro ‘MATCH’
# 4810|           if (MATCH(VIR_CONNECT_LIST_DOMAINS_FILTERS_ACTIVE) &&
# 4811|               !((MATCH(VIR_CONNECT_LIST_DOMAINS_ACTIVE) &&
# 4812|->                powerState != esxVI_VirtualMachinePowerState_PoweredOff) ||
# 4813|                 (MATCH(VIR_CONNECT_LIST_DOMAINS_INACTIVE) &&
# 4814|                  powerState == esxVI_VirtualMachinePowerState_PoweredOff)))

Error: GCC_ANALYZER_WARNING (CWE-457): [#def88]
libvirt-10.9.0-build/libvirt-10.9.0/src/esx/esx_driver.c:4814:27: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘powerState’
libvirt-10.9.0-build/libvirt-10.9.0/src/esx/esx_driver.c:4716:5: note: in expansion of macro ‘virCheckFlags’
libvirt-10.9.0-build/libvirt-10.9.0/src/esx/esx_driver.c:4737:9: note: in expansion of macro ‘MATCH’
libvirt-10.9.0-build/libvirt-10.9.0/src/esx/esx_driver.c:4751:20: note: in expansion of macro ‘MATCH’
libvirt-10.9.0-build/libvirt-10.9.0/src/esx/esx_driver.c:4810:13: note: in expansion of macro ‘MATCH’
libvirt-10.9.0-build/libvirt-10.9.0/src/esx/esx_driver.c:4811:16: note: in expansion of macro ‘MATCH’
libvirt-10.9.0-build/libvirt-10.9.0/src/esx/esx_driver.c:4813:16: note: in expansion of macro ‘MATCH’
# 4812|                  powerState != esxVI_VirtualMachinePowerState_PoweredOff) ||
# 4813|                 (MATCH(VIR_CONNECT_LIST_DOMAINS_INACTIVE) &&
# 4814|->                powerState == esxVI_VirtualMachinePowerState_PoweredOff)))
# 4815|               continue;
# 4816|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def89]
libvirt-10.9.0-build/libvirt-10.9.0/src/esx/esx_driver.c:4866:21: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘powerState’
libvirt-10.9.0-build/libvirt-10.9.0/src/esx/esx_driver.c:4716:5: note: in expansion of macro ‘virCheckFlags’
libvirt-10.9.0-build/libvirt-10.9.0/src/esx/esx_driver.c:4737:9: note: in expansion of macro ‘MATCH’
libvirt-10.9.0-build/libvirt-10.9.0/src/esx/esx_driver.c:4751:20: note: in expansion of macro ‘MATCH’
libvirt-10.9.0-build/libvirt-10.9.0/src/esx/esx_driver.c:4810:13: note: in expansion of macro ‘MATCH’
libvirt-10.9.0-build/libvirt-10.9.0/src/esx/esx_driver.c:4865:13: note: in expansion of macro ‘MATCH’
# 4864|           /* filter by domain state */
# 4865|           if (MATCH(VIR_CONNECT_LIST_DOMAINS_FILTERS_STATE)) {
# 4866|->             state = esxVI_VirtualMachinePowerState_ConvertToLibvirt(powerState);
# 4867|   
# 4868|               if (!((MATCH(VIR_CONNECT_LIST_DOMAINS_RUNNING) &&

Error: GCC_ANALYZER_WARNING (CWE-476): [#def90]
libvirt-10.9.0-build/libvirt-10.9.0/src/esx/esx_util.c: scope_hint: In function ‘esxUtil_ReplaceSpecialWindowsPathChars’
libvirt-10.9.0-build/libvirt-10.9.0/src/esx/esx_util.c:403:12: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘tmp’
libvirt-10.9.0-build/libvirt-10.9.0/src/esx/esx_util.c:424:16: note: in expansion of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/src/esx/esx_util.c: scope_hint: In function ‘esxUtil_ReplaceSpecialWindowsPathChars’
#  401|       size_t length;
#  402|   
#  403|->     while (*tmp != '\0') {
#  404|           length = strspn(tmp, specials);
#  405|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def91]
libvirt-10.9.0-build/libvirt-10.9.0/src/hyperv/hyperv_driver.c: scope_hint: In function ‘hypervDomainAttachFloppy’
libvirt-10.9.0-build/libvirt-10.9.0/src/hyperv/hyperv_driver.c:816:58: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘driveSettings’
/usr/include/glib-2.0/glib/gmacros.h:1365:7: note: in expansion of macro ‘_GLIB_AUTOPTR_CLEAR_FUNC_NAME’
/usr/include/glib-2.0/glib/gmacros.h:1381:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
libvirt-10.9.0-build/libvirt-10.9.0/redhat-linux-build/src/hyperv/hyperv_wmi_classes.generated.typedef:90:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
libvirt-10.9.0-build/libvirt-10.9.0/src/hyperv/hyperv_driver.c: scope_hint: In function ‘hypervDomainAttachFloppy’
#  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): [#def92]
libvirt-10.9.0-build/libvirt-10.9.0/src/hyperv/hyperv_driver.c: scope_hint: In function ‘hypervDomainAttachStorage’
libvirt-10.9.0-build/libvirt-10.9.0/src/hyperv/hyperv_driver.c:881:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘domain’
/usr/include/glib-2.0/glib/gmacros.h:1365:7: note: in expansion of macro ‘_GLIB_AUTOPTR_CLEAR_FUNC_NAME’
/usr/include/glib-2.0/glib/gmacros.h:1381:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
libvirt-10.9.0-build/libvirt-10.9.0/redhat-linux-build/src/hyperv/hyperv_wmi_classes.generated.typedef:90:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
libvirt-10.9.0-build/libvirt-10.9.0/src/hyperv/hyperv_driver.c: scope_hint: In function ‘hypervDomainAttachStorage’
#  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): [#def93]
libvirt-10.9.0-build/libvirt-10.9.0/src/hyperv/hyperv_driver.c:928:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘ideChannels[ctrlr_idx]’
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
/usr/include/glib-2.0/glib/gstrfuncs.h:324:38: note: in definition of macro ‘g_strdup’
#  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): [#def94]
libvirt-10.9.0-build/libvirt-10.9.0/src/hyperv/hyperv_driver.c:935:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘scsiControllers[ctrlr_idx]’
/usr/include/glib-2.0/glib/gstrfuncs.h:324:38: note: in definition of macro ‘g_strdup’
#  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): [#def95]
libvirt-10.9.0-build/libvirt-10.9.0/src/hyperv/hyperv_driver.c: scope_hint: In function ‘hypervDomainSetMemoryProperty’
libvirt-10.9.0-build/libvirt-10.9.0/src/hyperv/hyperv_driver.c:2245:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘domain’
/usr/include/glib-2.0/glib/gmacros.h:1365:7: note: in expansion of macro ‘_GLIB_AUTOPTR_CLEAR_FUNC_NAME’
/usr/include/glib-2.0/glib/gmacros.h:1381:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
libvirt-10.9.0-build/libvirt-10.9.0/redhat-linux-build/src/hyperv/hyperv_wmi_classes.generated.typedef:90:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
libvirt-10.9.0-build/libvirt-10.9.0/src/hyperv/hyperv_driver.c: scope_hint: In function ‘hypervDomainSetMemoryProperty’
libvirt-10.9.0-build/libvirt-10.9.0/src/hyperv/hyperv_driver.c: scope_hint: In function ‘hypervDomainSetMemoryProperty’
# 2243|   {
# 2244|       char uuid_string[VIR_UUID_STRING_BUFLEN];
# 2245|->     hypervPrivate *priv = domain->conn->privateData;
# 2246|       g_autoptr(Msvm_VirtualSystemSettingData) vssd = NULL;
# 2247|       g_autoptr(Msvm_MemorySettingData) memsd = NULL;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def96]
libvirt-10.9.0-build/libvirt-10.9.0/src/hyperv/hyperv_driver.c: scope_hint: In function ‘hypervDomainSetVcpusFlags’
libvirt-10.9.0-build/libvirt-10.9.0/src/hyperv/hyperv_driver.c:2503:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘domain’
/usr/include/glib-2.0/glib/gmacros.h:1365:7: note: in expansion of macro ‘_GLIB_AUTOPTR_CLEAR_FUNC_NAME’
/usr/include/glib-2.0/glib/gmacros.h:1381:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
libvirt-10.9.0-build/libvirt-10.9.0/redhat-linux-build/src/hyperv/hyperv_wmi_classes.generated.typedef:90:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
libvirt-10.9.0-build/libvirt-10.9.0/src/hyperv/hyperv_driver.c: scope_hint: In function ‘hypervDomainSetVcpusFlags’
libvirt-10.9.0-build/libvirt-10.9.0/src/hyperv/hyperv_driver.c: scope_hint: In function ‘hypervDomainSetVcpusFlags’
# 2501|   {
# 2502|       char uuid_string[VIR_UUID_STRING_BUFLEN];
# 2503|->     hypervPrivate *priv = domain->conn->privateData;
# 2504|       g_autoptr(Msvm_VirtualSystemSettingData) vssd = NULL;
# 2505|       g_autoptr(Msvm_ProcessorSettingData) proc_sd = NULL;

Error: GCC_ANALYZER_WARNING (CWE-465): [#def97]
libvirt-10.9.0-build/libvirt-10.9.0/src/hyperv/hyperv_wmi.c: scope_hint: In function ‘hypervFreeObject.part.0’
libvirt-10.9.0-build/libvirt-10.9.0/src/hyperv/hyperv_wmi.c:1011:19: warning[-Wanalyzer-deref-before-check]: check of ‘object’ for NULL after already dereferencing it
# 1009|       serializerContext = wsmc_get_serialization_context(((hypervObject *)object)->priv->client);
# 1010|   
# 1011|->     while (object != NULL) {
# 1012|           next = ((hypervObject *)object)->next;
# 1013|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def98]
libvirt-10.9.0-build/libvirt-10.9.0/src/interface/interface_backend_udev.c: scope_hint: In function ‘udevGetIfaceDef’
libvirt-10.9.0-build/libvirt-10.9.0/src/interface/interface_backend_udev.c:992:27: warning[-Wanalyzer-null-argument]: use of NULL ‘name’ where non-null expected
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virlog.h:24: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/interface/interface_backend_udev.c:26: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/interface/interface_backend_udev.c:1036:5: note: in expansion of macro ‘virCheckFlags’
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/glibcompat.h:21: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:30: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/interface/interface_backend_udev.c:938:22: note: in expansion of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/src/interface/interface_backend_udev.c: scope_hint: In function ‘udevGetIfaceDef’
libvirt-10.9.0-build/libvirt-10.9.0/src/interface/interface_backend_udev.c:949:21: note: in expansion of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:28: included_from: Included from here.
/usr/include/string.h:273:14: note: argument 1 of ‘strrchr’ must be non-null
#  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-688): [#def99]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/vircgroupv1.c: scope_hint: In function ‘virCgroupV1DetectPlacement’
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:90:22: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-10.9.0-build/libvirt-10.9.0/src/util/vircgroupv1.c:368:26: note: in expansion of macro ‘STREQ’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/vircgroupv1.c:355:21: note: in expansion of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/vircgroupv1.c: scope_hint: In function ‘virCgroupV1DetectPlacement’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/vircgroupv1.c:368:26: note: in expansion of macro ‘STREQ’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/vircgroupv1.c:368:26: note: in expansion of macro ‘STREQ’
/usr/include/string.h:156:12: note: argument 1 of ‘strcmp’ must be non-null
#   88|   
#   89|   /* String equality tests, suggested by Jim Meyering. */
#   90|-> #define STREQ(a, b) (strcmp(a, b) == 0)
#   91|   #define STRCASEEQ(a, b) (g_ascii_strcasecmp(a, b) == 0)
#   92|   #define STRNEQ(a, b) (strcmp(a, b) != 0)

Error: GCC_ANALYZER_WARNING (CWE-688): [#def100]
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:92:23: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-10.9.0-build/libvirt-10.9.0/src/conf/nwfilter_params.c:424:21: note: in expansion of macro ‘STRNEQ’
libvirt-10.9.0-build/libvirt-10.9.0/src/conf/nwfilter_params.c:416:13: note: in expansion of macro ‘STREQ’
libvirt-10.9.0-build/libvirt-10.9.0/src/conf/nwfilter_params.c:416:13: note: in expansion of macro ‘STREQ’
libvirt-10.9.0-build/libvirt-10.9.0/src/conf/nwfilter_params.c:416:13: note: in expansion of macro ‘STREQ’
libvirt-10.9.0-build/libvirt-10.9.0/src/conf/nwfilter_params.c:424:21: note: in expansion of macro ‘STRNEQ’
libvirt-10.9.0-build/libvirt-10.9.0/src/conf/nwfilter_params.c:424:21: note: in expansion of macro ‘STRNEQ’
libvirt-10.9.0-build/libvirt-10.9.0/src/conf/nwfilter_params.c:424:21: note: in expansion of macro ‘STRNEQ’
libvirt-10.9.0-build/libvirt-10.9.0/src/conf/nwfilter_params.c:424:21: note: in expansion of macro ‘STRNEQ’
libvirt-10.9.0-build/libvirt-10.9.0/src/conf/nwfilter_params.c:424:21: note: in expansion of macro ‘STRNEQ’
libvirt-10.9.0-build/libvirt-10.9.0/src/conf/nwfilter_params.c:424:21: note: in expansion of macro ‘STRNEQ’
/usr/include/string.h:156:12: note: argument 1 of ‘strcmp’ must be non-null
#   90|   #define STREQ(a, b) (strcmp(a, b) == 0)
#   91|   #define STRCASEEQ(a, b) (g_ascii_strcasecmp(a, b) == 0)
#   92|-> #define STRNEQ(a, b) (strcmp(a, b) != 0)
#   93|   #define STRCASENEQ(a, b) (g_ascii_strcasecmp(a, b) != 0)
#   94|   #define STREQLEN(a, b, n) (strncmp(a, b, n) == 0)

Error: GCC_ANALYZER_WARNING (CWE-688): [#def101]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/viralloc.h:25: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/tests/testutils.h:23: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/tests/qemudomaincheckpointxml2xmltest.c:11: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/tests/qemudomaincheckpointxml2xmltest.c: scope_hint: In function ‘testCompareXMLToXMLFiles’
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:92:23: warning[-Wanalyzer-null-argument]: use of NULL ‘outXmlData’ where non-null expected
libvirt-10.9.0-build/libvirt-10.9.0/tests/qemudomaincheckpointxml2xmltest.c:92:9: note: in expansion of macro ‘STRNEQ’
libvirt-10.9.0-build/libvirt-10.9.0/tests/qemudomaincheckpointxml2xmltest.c:92:9: note: in expansion of macro ‘STRNEQ’
libvirt-10.9.0-build/libvirt-10.9.0/tests/qemudomaincheckpointxml2xmltest.c:92:9: note: in expansion of macro ‘STRNEQ’
libvirt-10.9.0-build/libvirt-10.9.0/tests/qemudomaincheckpointxml2xmltest.c:92:9: note: in expansion of macro ‘STRNEQ’
libvirt-10.9.0-build/libvirt-10.9.0/tests/qemudomaincheckpointxml2xmltest.c:6: included_from: Included from here.
/usr/include/string.h:156:12: note: argument 1 of ‘strcmp’ must be non-null
#   90|   #define STREQ(a, b) (strcmp(a, b) == 0)
#   91|   #define STRCASEEQ(a, b) (g_ascii_strcasecmp(a, b) == 0)
#   92|-> #define STRNEQ(a, b) (strcmp(a, b) != 0)
#   93|   #define STRCASENEQ(a, b) (g_ascii_strcasecmp(a, b) != 0)
#   94|   #define STREQLEN(a, b, n) (strncmp(a, b, n) == 0)

Error: GCC_ANALYZER_WARNING (CWE-688): [#def102]
libvirt-10.9.0-build/libvirt-10.9.0/src/security/security_driver.h:21: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/security/security_selinux.c:28: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/security/security_selinux.c: scope_hint: In function ‘virSecuritySELinuxSetFilecon’
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:92:23: warning[-Wanalyzer-null-argument]: use of NULL ‘tcon’ where non-null expected
libvirt-10.9.0-build/libvirt-10.9.0/src/security/security_selinux.c:1444:21: note: in expansion of macro ‘STRNEQ’
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/glibcompat.h:21: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:30: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/security/security_selinux.c:122:18: note: in expansion of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/src/security/security_selinux.c: scope_hint: In function ‘virSecuritySELinuxSetFilecon’
libvirt-10.9.0-build/libvirt-10.9.0/src/security/security_selinux.c: scope_hint: In function ‘virSecuritySELinuxSetFilecon’
libvirt-10.9.0-build/libvirt-10.9.0/src/security/security_selinux.c:1444:21: note: in expansion of macro ‘STRNEQ’
libvirt-10.9.0-build/libvirt-10.9.0/src/security/security_selinux.c:1444:21: note: in expansion of macro ‘STRNEQ’
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:28: included_from: Included from here.
/usr/include/string.h:156:12: note: argument 2 of ‘strcmp’ must be non-null
#   90|   #define STREQ(a, b) (strcmp(a, b) == 0)
#   91|   #define STRCASEEQ(a, b) (g_ascii_strcasecmp(a, b) == 0)
#   92|-> #define STRNEQ(a, b) (strcmp(a, b) != 0)
#   93|   #define STRCASENEQ(a, b) (g_ascii_strcasecmp(a, b) != 0)
#   94|   #define STREQLEN(a, b, n) (strncmp(a, b, n) == 0)

Error: GCC_ANALYZER_WARNING (CWE-688): [#def103]
libvirt-10.9.0-build/libvirt-10.9.0/src/conf/virchrdev.h:24: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/conf/virchrdev.c:28: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/conf/virchrdev.c: scope_hint: In function ‘virChrdevLockFilePath’
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:98:26: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:100:24: note: in expansion of macro ‘STRPREFIX’
libvirt-10.9.0-build/libvirt-10.9.0/src/conf/virchrdev.c:77:16: note: in expansion of macro ‘STRSKIP’
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/glibcompat.h:21: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:30: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/conf/virchrdev.c:74:15: note: in expansion of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/src/conf/virchrdev.c: scope_hint: In function ‘virChrdevLockFilePath’
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:100:24: note: in expansion of macro ‘STRPREFIX’
libvirt-10.9.0-build/libvirt-10.9.0/src/conf/virchrdev.c:77:16: note: in expansion of macro ‘STRSKIP’
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:100:24: note: in expansion of macro ‘STRPREFIX’
libvirt-10.9.0-build/libvirt-10.9.0/src/conf/virchrdev.c:77:16: note: in expansion of macro ‘STRSKIP’
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:28: included_from: Included from here.
/usr/include/string.h:159:12: note: argument 1 of ‘strncmp’ must be non-null
#   96|   #define STRNEQLEN(a, b, n) (strncmp(a, b, n) != 0)
#   97|   #define STRCASENEQLEN(a, b, n) (g_ascii_strncasecmp(a, b, n) != 0)
#   98|-> #define STRPREFIX(a, b) (strncmp(a, b, strlen(b)) == 0)
#   99|   #define STRCASEPREFIX(a, b) (g_ascii_strncasecmp(a, b, strlen(b)) == 0)
#  100|   #define STRSKIP(a, b) (STRPREFIX(a, b) ? (a) + strlen(b) : NULL)

Error: GCC_ANALYZER_WARNING (CWE-688): [#def104]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virenum.h:21: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virconf.h:23: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/libxl/xen_xl.c:26: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/libxl/xen_xl.c: scope_hint: In function ‘xenParseXLChannel’
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:98:26: warning[-Wanalyzer-null-argument]: use of NULL ‘type’ where non-null expected
libvirt-10.9.0-build/libvirt-10.9.0/src/libxl/xen_xl.c:993:17: note: in expansion of macro ‘STRPREFIX’
libvirt-10.9.0-build/libvirt-10.9.0/src/libxl/xen_xl.c:975:37: note: in expansion of macro ‘STRPREFIX’
libvirt-10.9.0-build/libvirt-10.9.0/src/libxl/xen_xl.c:978:37: note: in expansion of macro ‘STRPREFIX’
libvirt-10.9.0-build/libvirt-10.9.0/src/libxl/xen_xl.c:993:17: note: in expansion of macro ‘STRPREFIX’
libvirt-10.9.0-build/libvirt-10.9.0/src/libxl/xen_xl.c:993:17: note: in expansion of macro ‘STRPREFIX’
/usr/include/libxl.h:843: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/libxl/xen_xl.c:24: included_from: Included from here.
/usr/include/string.h:159:12: note: argument 1 of ‘strncmp’ must be non-null
#   96|   #define STRNEQLEN(a, b, n) (strncmp(a, b, n) != 0)
#   97|   #define STRCASENEQLEN(a, b, n) (g_ascii_strncasecmp(a, b, n) != 0)
#   98|-> #define STRPREFIX(a, b) (strncmp(a, b, strlen(b)) == 0)
#   99|   #define STRCASEPREFIX(a, b) (g_ascii_strncasecmp(a, b, strlen(b)) == 0)
#  100|   #define STRSKIP(a, b) (STRPREFIX(a, b) ? (a) + strlen(b) : NULL)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def105]
libvirt-10.9.0-build/libvirt-10.9.0/src/esx/esx_util.c:26: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/esx/esx_util.c: scope_hint: In function ‘esxUtil_ParseDatastorePath’
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:98:26: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘saveptr’
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:100:24: note: in expansion of macro ‘STRPREFIX’
libvirt-10.9.0-build/libvirt-10.9.0/src/esx/esx_util.c:219:17: note: in expansion of macro ‘STRSKIP’
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/glibcompat.h:21: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:30: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/esx/esx_util.c:216:27: note: in expansion of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/src/esx/esx_util.c: scope_hint: In function ‘esxUtil_ParseDatastorePath’
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:100:24: note: in expansion of macro ‘STRPREFIX’
libvirt-10.9.0-build/libvirt-10.9.0/src/esx/esx_util.c:219:17: note: in expansion of macro ‘STRSKIP’
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:100:24: note: in expansion of macro ‘STRPREFIX’
libvirt-10.9.0-build/libvirt-10.9.0/src/esx/esx_util.c:219:17: note: in expansion of macro ‘STRSKIP’
#   96|   #define STRNEQLEN(a, b, n) (strncmp(a, b, n) != 0)
#   97|   #define STRCASENEQLEN(a, b, n) (g_ascii_strncasecmp(a, b, n) != 0)
#   98|-> #define STRPREFIX(a, b) (strncmp(a, b, strlen(b)) == 0)
#   99|   #define STRCASEPREFIX(a, b) (g_ascii_strncasecmp(a, b, strlen(b)) == 0)
#  100|   #define STRSKIP(a, b) (STRPREFIX(a, b) ? (a) + strlen(b) : NULL)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def106]
libvirt-10.9.0-build/libvirt-10.9.0/src/libxl/libxl_driver.c: scope_hint: In function ‘libxlGetDHCPInterfaces’
libvirt-10.9.0-build/libvirt-10.9.0/src/libxl/libxl_driver.c:6301:51: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘iface’
# 6299|           for (j = 0; j < n_leases; j++) {
# 6300|               virNetworkDHCPLeasePtr lease = leases[j];
# 6301|->             virDomainIPAddressPtr ip_addr = &iface->addrs[j];
# 6302|   
# 6303|               ip_addr->addr = g_strdup(lease->ipaddr);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def107]
libvirt-10.9.0-build/libvirt-10.9.0/src/libxl/libxl_logger.c: scope_hint: In function ‘libxlLoggerNew’
libvirt-10.9.0-build/libvirt-10.9.0/src/libxl/libxl_logger.c:156:34: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(g_strdup_printf("%s/libxl-driver.log", logDir), "a")’
#  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): [#def108]
libvirt-10.9.0-build/libvirt-10.9.0/src/libxl/libxl_logger.c:156:34: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(g_strdup_printf("%s/libxl-driver.log", logDir), "a")’
#  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): [#def109]
libvirt-10.9.0-build/libvirt-10.9.0/src/libxl/libxl_logger.c: scope_hint: In function ‘libxlLoggerOpenFile’
libvirt-10.9.0-build/libvirt-10.9.0/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")’
#  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): [#def110]
libvirt-10.9.0-build/libvirt-10.9.0/src/libxl/libxl_logger.c:193:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(g_strdup_printf("%s/%s.log", *logger.logDir,  name), "a")’
#  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-476): [#def111]
libvirt-10.9.0-build/libvirt-10.9.0/src/lxc/lxc_driver.c: scope_hint: In function ‘lxcDomainAttachDeviceConfig’
libvirt-10.9.0-build/libvirt-10.9.0/src/lxc/lxc_driver.c:2999:16: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dev’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virerror.h:24: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/lxc/lxc_driver.c:37: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/lxc/lxc_driver.c:4422:5: note: in expansion of macro ‘virCheckFlags’
# 2997|       virDomainHostdevDef *hostdev;
# 2998|   
# 2999|->     switch (dev->type) {
# 3000|       case VIR_DOMAIN_DEVICE_DISK:
# 3001|           disk = dev->data.disk;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def112]
libvirt-10.9.0-build/libvirt-10.9.0/src/lxc/lxc_driver.c: scope_hint: In function ‘lxcDomainDetachDeviceConfig’
libvirt-10.9.0-build/libvirt-10.9.0/src/lxc/lxc_driver.c:3147:16: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dev’
libvirt-10.9.0-build/libvirt-10.9.0/src/lxc/lxc_driver.c:4585:5: note: in expansion of macro ‘virCheckFlags’
# 3145|       int idx;
# 3146|   
# 3147|->     switch (dev->type) {
# 3148|       case VIR_DOMAIN_DEVICE_DISK:
# 3149|           disk = dev->data.disk;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def113]
libvirt-10.9.0-build/libvirt-10.9.0/src/lxc/lxc_driver.c: scope_hint: In function ‘lxcDomainAttachDeviceLive’
libvirt-10.9.0-build/libvirt-10.9.0/src/lxc/lxc_driver.c:3936:16: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dev’
libvirt-10.9.0-build/libvirt-10.9.0/src/lxc/lxc_driver.c:4422:5: note: in expansion of macro ‘virCheckFlags’
# 3934|       int ret = -1;
# 3935|   
# 3936|->     switch (dev->type) {
# 3937|       case VIR_DOMAIN_DEVICE_DISK:
# 3938|           ret = lxcDomainAttachDeviceDiskLive(driver, vm, dev);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def114]
libvirt-10.9.0-build/libvirt-10.9.0/src/lxc/lxc_driver.c: scope_hint: In function ‘lxcDomainDetachDeviceLive’
libvirt-10.9.0-build/libvirt-10.9.0/src/lxc/lxc_driver.c:4361:16: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dev’
libvirt-10.9.0-build/libvirt-10.9.0/src/lxc/lxc_driver.c:4585:5: note: in expansion of macro ‘virCheckFlags’
# 4359|       int ret = -1;
# 4360|   
# 4361|->     switch (dev->type) {
# 4362|       case VIR_DOMAIN_DEVICE_DISK:
# 4363|           ret = lxcDomainDetachDeviceDiskLive(vm, dev);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def115]
libvirt-10.9.0-build/libvirt-10.9.0/src/lxc/lxc_fuse.c: scope_hint: In function ‘lxcProcReadMeminfo’
libvirt-10.9.0-build/libvirt-10.9.0/src/lxc/lxc_fuse.c:208:10: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(hostpath, "r")’
#  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): [#def116]
libvirt-10.9.0-build/libvirt-10.9.0/src/lxc/lxc_fuse.c:208:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(hostpath, "r")’
#  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): [#def117]
libvirt-10.9.0-build/libvirt-10.9.0/src/node_device/node_device_driver.c: scope_hint: In function ‘nodeDeviceUpdateMediatedDevices’
libvirt-10.9.0-build/libvirt-10.9.0/src/node_device/node_device_driver.c:1917:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘defs’
# 1915|   
# 1916|       for (i = 0; i < data.ndefs; i++)
# 1917|->         if (nodeDeviceUpdateMediatedDevice(defs[i], true) < 0)
# 1918|               return -1;
# 1919|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def118]
libvirt-10.9.0-build/libvirt-10.9.0/src/nwfilter/nwfilter_dhcpsnoop.c: scope_hint: In function ‘virNWFilterSnoopLeaseFileLoad’
libvirt-10.9.0-build/libvirt-10.9.0/src/nwfilter/nwfilter_dhcpsnoop.c:1727:10: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/run/libvirt/network/nwfilter.leases", "r")’
# 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): [#def119]
libvirt-10.9.0-build/libvirt-10.9.0/src/nwfilter/nwfilter_dhcpsnoop.c:1727:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/run/libvirt/network/nwfilter.leases", "r")’
# 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): [#def120]
libvirt-10.9.0-build/libvirt-10.9.0/src/openvz/openvz_conf.c: scope_hint: In function ‘openvzWriteConfigParam’
libvirt-10.9.0-build/libvirt-10.9.0/src/openvz/openvz_conf.c:550:10: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(conf_file, "r")’
#  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): [#def121]
libvirt-10.9.0-build/libvirt-10.9.0/src/openvz/openvz_conf.c:550:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(conf_file, "r")’
#  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): [#def122]
libvirt-10.9.0-build/libvirt-10.9.0/src/openvz/openvz_conf.c: scope_hint: In function ‘openvzReadConfigParam’
libvirt-10.9.0-build/libvirt-10.9.0/src/openvz/openvz_conf.c:620:10: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(conf_file, "r")’
#  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): [#def123]
libvirt-10.9.0-build/libvirt-10.9.0/src/openvz/openvz_conf.c:620:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(conf_file, "r")’
#  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): [#def124]
libvirt-10.9.0-build/libvirt-10.9.0/src/openvz/openvz_conf.c: scope_hint: In function ‘openvz_copyfile’
libvirt-10.9.0-build/libvirt-10.9.0/src/openvz/openvz_conf.c:682:10: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(from_path, "r")’
#  680|       int bytes_read;
#  681|   
#  682|->     fp = fopen(from_path, "r");
#  683|       if (fp == NULL)
#  684|           return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def125]
libvirt-10.9.0-build/libvirt-10.9.0/src/openvz/openvz_conf.c:682:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(from_path, "r")’
#  680|       int bytes_read;
#  681|   
#  682|->     fp = fopen(from_path, "r");
#  683|       if (fp == NULL)
#  684|           return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def126]
libvirt-10.9.0-build/libvirt-10.9.0/src/openvz/openvz_conf.c: scope_hint: In function ‘openvzGetVPSUUID’
libvirt-10.9.0-build/libvirt-10.9.0/src/openvz/openvz_conf.c:822:10: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(conf_file, "r")’
#  820|           return -1;
#  821|   
#  822|->     fp = fopen(conf_file, "r");
#  823|       if (fp == NULL)
#  824|           goto cleanup;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def127]
libvirt-10.9.0-build/libvirt-10.9.0/src/openvz/openvz_conf.c:822:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(conf_file, "r")’
#  820|           return -1;
#  821|   
#  822|->     fp = fopen(conf_file, "r");
#  823|       if (fp == NULL)
#  824|           goto cleanup;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def128]
libvirt-10.9.0-build/libvirt-10.9.0/src/openvz/openvz_conf.c: scope_hint: In function ‘openvzSetDefinedUUID’
libvirt-10.9.0-build/libvirt-10.9.0/src/openvz/openvz_conf.c:876:14: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(conf_file, "a")’
#  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): [#def129]
libvirt-10.9.0-build/libvirt-10.9.0/src/openvz/openvz_conf.c:876:14: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(conf_file, "a")’
#  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): [#def130]
libvirt-10.9.0-build/libvirt-10.9.0/src/openvz/openvz_driver.c: scope_hint: In function ‘openvzGetProcessInfo’
libvirt-10.9.0-build/libvirt-10.9.0/src/openvz/openvz_driver.c:1418:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/proc/vz/vestat", "r")’
# 1416|   */
# 1417|   
# 1418|->     if ((fp = fopen("/proc/vz/vestat", "r")) == NULL)
# 1419|           return -1;
# 1420|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def131]
libvirt-10.9.0-build/libvirt-10.9.0/src/openvz/openvz_driver.c:1418:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/proc/vz/vestat", "r")’
# 1416|   */
# 1417|   
# 1418|->     if ((fp = fopen("/proc/vz/vestat", "r")) == NULL)
# 1419|           return -1;
# 1420|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def132]
libvirt-10.9.0-build/libvirt-10.9.0/src/qemu/qemu_block.c: scope_hint: In function ‘qemuBlockStorageSourceGetISCSIProps’
libvirt-10.9.0-build/libvirt-10.9.0/src/qemu/qemu_block.c:615:19: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
/usr/lib64/glib-2.0/include/glibconfig.h:9: included_from: Included from here.
/usr/include/glib-2.0/glib/gtypes.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib/galloca.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib.h:32: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/glibcompat.h:21: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:30: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/qemu/qemu_block.h:21: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/qemu/qemu_block.c:21: included_from: Included from here.
/usr/include/glib-2.0/glib/gmacros.h:1365:7: note: in expansion of macro ‘_GLIB_AUTOPTR_CLEAR_FUNC_NAME’
/usr/include/glib-2.0/glib/gmacros.h:1381:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virjson.h:280:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
/usr/include/glib-2.0/glib/gmacros.h:1381:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virjson.h:280:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
/usr/include/glib-2.0/glib/gstrfuncs.h:324:38: note: in definition of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/src/qemu/qemu_block.c:612:14: note: in expansion of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/src/qemu/qemu_block.c: scope_hint: In function ‘qemuBlockStorageSourceGetISCSIProps’
<built-in>: note: 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-688): [#def133]
libvirt-10.9.0-build/libvirt-10.9.0/src/qemu/qemu_block.c:615:19: warning[-Wanalyzer-null-argument]: use of NULL ‘backingPath’ where non-null expected
/usr/include/glib-2.0/glib/gmacros.h:1365:7: note: in expansion of macro ‘_GLIB_AUTOPTR_CLEAR_FUNC_NAME’
/usr/include/glib-2.0/glib/gmacros.h:1381:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virjson.h:280:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
/usr/include/glib-2.0/glib/gmacros.h:1381:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virjson.h:280:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
/usr/include/glib-2.0/glib/gstrfuncs.h:324:38: note: in definition of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/src/qemu/qemu_block.c:612:14: note: in expansion of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/src/qemu/qemu_block.c: scope_hint: In function ‘qemuBlockStorageSourceGetISCSIProps’
<built-in>: note: 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): [#def134]
libvirt-10.9.0-build/libvirt-10.9.0/src/qemu/qemu_blockjob.c: scope_hint: In function ‘qemuBlockJobProcessEventCompletedActiveCommit’
libvirt-10.9.0-build/libvirt-10.9.0/src/qemu/qemu_blockjob.c:1162:30: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘baseparent’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virlog.h:88:5: note: in expansion of macro ‘VIR_DEBUG_INT’
libvirt-10.9.0-build/libvirt-10.9.0/src/qemu/qemu_blockjob.c:1535:5: note: in expansion of macro ‘VIR_DEBUG’
# 1160|           VIR_WARN("Unable to move disk metadata on vm %s", vm->def->name);
# 1161|   
# 1162|->     baseparent->backingStore = NULL;
# 1163|       job->disk->src = job->data.commit.base;
# 1164|       job->disk->src->readonly = job->data.commit.top->readonly;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def135]
libvirt-10.9.0-build/libvirt-10.9.0/src/qemu/qemu_namespace.c: scope_hint: In function ‘qemuNamespaceUnlinkPaths’
libvirt-10.9.0-build/libvirt-10.9.0/src/qemu/qemu_namespace.c:1459:41: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mount’
libvirt-10.9.0-build/libvirt-10.9.0/src/qemu/qemu_namespace.c: scope_hint: In function ‘qemuNamespaceUnlinkPaths’
/usr/include/glib-2.0/glib/glib-autocleanups.h:103:1: note: in expansion of macro ‘G_DEFINE_AUTO_CLEANUP_FREE_FUNC’
libvirt-10.9.0-build/libvirt-10.9.0/src/qemu/qemu_namespace.c: scope_hint: In function ‘qemuNamespaceUnlinkPaths’
/usr/include/glib-2.0/glib/glib-autocleanups.h:103:1: note: in expansion of macro ‘G_DEFINE_AUTO_CLEANUP_FREE_FUNC’
libvirt-10.9.0-build/libvirt-10.9.0/src/qemu/qemu_namespace.c: scope_hint: In function ‘qemuNamespaceUnlinkPaths’
# 1457|               const char *const *devices = (const char *const *)cfg->cgroupDeviceACL;
# 1458|   
# 1459|->             for (mount = devMountsPath; *mount; mount++) {
# 1460|                   if (STREQ(*mount, "/dev"))
# 1461|                       continue;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def136]
libvirt-10.9.0-build/libvirt-10.9.0/src/qemu/qemu_nbdkit.c: scope_hint: In function ‘qemuNbdkitCapsQuery’
libvirt-10.9.0-build/libvirt-10.9.0/src/qemu/qemu_nbdkit.c:252:9: warning[-Wanalyzer-null-argument]: use of NULL ‘*caps.path’ where non-null expected
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/qemu/qemu_nbdkit.c:21: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/qemu/qemu_nbdkit.c:225:18: note: in expansion of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/src/qemu/qemu_nbdkit.c: scope_hint: In function ‘qemuNbdkitCapsQuery’
/usr/include/features.h:511: included_from: Included from here.
/usr/include/bits/libc-header-start.h:33: included_from: Included from here.
/usr/include/limits.h:26: included_from: Included from here.
/opt/gcc-latest/lib/gcc/x86_64-pc-linux-gnu/15.0.0/include/limits.h:210: included_from: Included from here.
/opt/gcc-latest/lib/gcc/x86_64-pc-linux-gnu/15.0.0/include/syslimits.h:9: included_from: Included from here.
/opt/gcc-latest/lib/gcc/x86_64-pc-linux-gnu/15.0.0/include/limits.h:34: included_from: Included from here.
/usr/lib64/glib-2.0/include/glibconfig.h:11: included_from: Included from here.
/usr/include/glib-2.0/glib/gtypes.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib/galloca.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib.h:32: included_from: Included from here.
/usr/include/sys/stat.h:227:12: note: argument 1 of ‘stat’ must be non-null
#  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-10.9.0-build/libvirt-10.9.0/src/qemu/qemu_nbdkit.c: scope_hint: In function ‘qemuNbdkitProcessStart’
libvirt-10.9.0-build/libvirt-10.9.0/src/qemu/qemu_nbdkit.c:1259:19: warning[-Wanalyzer-malloc-leak]: leak of ‘nbd_create()’
# 1257|                * provide a useful message to the user.
# 1258|                */
# 1259|->             nbd = nbd_create();
# 1260|               if (nbd_connect_unix(nbd, proc->socketfile) < 0) {
# 1261|                   VIR_WARN("nbd_connect_unix failed: %s", nbd_get_error());

Error: GCC_ANALYZER_WARNING (CWE-688): [#def138]
libvirt-10.9.0-build/libvirt-10.9.0/src/qemu/qemu_nbdkit.c:1260:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘nbd_create()’ where non-null expected
libvirt-10.9.0-build/libvirt-10.9.0/src/qemu/qemu_nbdkit.c:23: included_from: Included from here.
/usr/include/libnbd.h:598:12: note: argument 1 of ‘nbd_connect_unix’ must be non-null
# 1258|                */
# 1259|               nbd = nbd_create();
# 1260|->             if (nbd_connect_unix(nbd, proc->socketfile) < 0) {
# 1261|                   VIR_WARN("nbd_connect_unix failed: %s", nbd_get_error());
# 1262|                   nbd_close(nbd);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def139]
libvirt-10.9.0-build/libvirt-10.9.0/src/qemu/qemu_vhost_user.c:330:24: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘vu’
libvirt-10.9.0-build/libvirt-10.9.0/src/qemu/qemu_vhost_user.c: scope_hint: In function ‘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-688): [#def140]
libvirt-10.9.0-build/libvirt-10.9.0/src/rpc/virnetsocket.c: scope_hint: In function ‘virNetSocketNewConnectUNIX’
libvirt-10.9.0-build/libvirt-10.9.0/src/rpc/virnetsocket.c:754:9: warning[-Wanalyzer-null-argument]: use of NULL ‘lockpath’ where non-null expected
libvirt-10.9.0-build/libvirt-10.9.0/src/rpc/virnetsocket.c:45: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virlog.h:88:5: note: in expansion of macro ‘VIR_DEBUG_INT’
libvirt-10.9.0-build/libvirt-10.9.0/src/rpc/virnetsocket.c:248:5: note: in expansion of macro ‘VIR_DEBUG’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virlog.h:81:72: note: in definition of macro ‘VIR_INFO_INT’
libvirt-10.9.0-build/libvirt-10.9.0/src/rpc/virnetsocket.c:303:5: note: in expansion of macro ‘PROBE’
libvirt-10.9.0-build/libvirt-10.9.0/src/rpc/virnetsocket.c:306:44: note: in expansion of macro ‘NULLSTR’
libvirt-10.9.0-build/libvirt-10.9.0/src/rpc/virnetsocket.c:25: included_from: Included from here.
/usr/include/unistd.h:858:12: note: argument 1 of ‘unlink’ must be non-null
#  752|    cleanup:
#  753|       if (lockfd != -1) {
#  754|->         unlink(lockpath);
#  755|       }
#  756|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def141]
libvirt-10.9.0-build/libvirt-10.9.0/src/rpc/virnetsocket.c: scope_hint: In function ‘virNetSocketListen’
libvirt-10.9.0-build/libvirt-10.9.0/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): [#def142]
libvirt-10.9.0-build/libvirt-10.9.0/src/rpc/virnetsocket.c:2040:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*sock.fd’
# 2038|           return -1;
# 2039|       }
# 2040|->     virObjectUnlock(sock);
# 2041|       return 0;
# 2042|   }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def143]
libvirt-10.9.0-build/libvirt-10.9.0/src/rpc/virnetsshsession.c: scope_hint: In function ‘virNetSSHKbIntCb’
libvirt-10.9.0-build/libvirt-10.9.0/src/rpc/virnetsshsession.c:223:20: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
/usr/include/glib-2.0/glib/glist.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib/ghash.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:52: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/glibcompat.h:21: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:30: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/rpc/virnetsshsession.h:23: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/rpc/virnetsshsession.c:24: included_from: Included from here.
/usr/include/glib-2.0/glib/gmem.h:335:57: note: in expansion of macro ‘_G_NEW’
libvirt-10.9.0-build/libvirt-10.9.0/src/rpc/virnetsshsession.c:215:15: note: in expansion of macro ‘g_new0’
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
/usr/include/glib-2.0/glib/gstrfuncs.h:324:38: note: in definition of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/src/rpc/virnetsshsession.c:219:29: note: in expansion of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/src/rpc/virnetsshsession.c: scope_hint: In function ‘virNetSSHKbIntCb’
/usr/include/libssh2.h:99: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/rpc/virnetsshsession.c:21: included_from: Included from here.
/usr/include/string.h:273:14: note: argument 1 of ‘strrchr’ must be non-null
#  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-775): [#def144]
libvirt-10.9.0-build/libvirt-10.9.0/src/storage/storage_backend_fs.c: scope_hint: In function ‘virStorageBackendFileSystemIsMounted’
libvirt-10.9.0-build/libvirt-10.9.0/src/storage/storage_backend_fs.c:247:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/etc/mtab", "r")’
#  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): [#def145]
libvirt-10.9.0-build/libvirt-10.9.0/src/storage/storage_backend_fs.c:247:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/etc/mtab", "r")’
#  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-476): [#def146]
libvirt-10.9.0-build/libvirt-10.9.0/src/storage/storage_backend_logical.c: scope_hint: In function ‘virStorageBackendLogicalMatchPoolSource’
libvirt-10.9.0-build/libvirt-10.9.0/src/storage/storage_backend_logical.c:587:35: warning[-Wanalyzer-null-dereference]: 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): [#def147]
libvirt-10.9.0-build/libvirt-10.9.0/src/storage/storage_backend_zfs.c: scope_hint: In function ‘virStorageBackendZFSRefreshPool’
libvirt-10.9.0-build/libvirt-10.9.0/src/storage/storage_backend_zfs.c:248:16: warning[-Wanalyzer-null-argument]: use of NULL ‘zpool_props’ where non-null expected
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/glibcompat.h:21: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:30: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/viralloc.h:25: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/storage/storage_backend_zfs.c:24: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/storage/storage_backend_zfs.c:235:29: note: in expansion of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/src/storage/storage_backend_zfs.c: scope_hint: In function ‘virStorageBackendZFSRefreshPool’
<built-in>: note: 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): [#def148]
libvirt-10.9.0-build/libvirt-10.9.0/src/storage/storage_util.c: scope_hint: In function ‘virStorageBackendBuildLocal’
libvirt-10.9.0-build/libvirt-10.9.0/src/storage/storage_util.c:2785:15: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/glibcompat.h:21: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:30: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/datatypes.h:24: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/storage/storage_util.c:46: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/storage/storage_util.c:2784:14: note: in expansion of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/src/storage/storage_util.c: scope_hint: In function ‘virStorageBackendBuildLocal’
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:28: included_from: Included from here.
/usr/include/string.h:273:14: note: argument 1 of ‘strrchr’ must be non-null
# 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): [#def149]
libvirt-10.9.0-build/libvirt-10.9.0/src/storage_file/storage_source_backingstore.c: scope_hint: In function ‘virStorageSourceParseNBDColonString’
libvirt-10.9.0-build/libvirt-10.9.0/src/storage_file/storage_source_backingstore.c:311:24: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/glibcompat.h:21: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:30: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/storage_file/storage_source_backingstore.c:24: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/storage_file/storage_source_backingstore.c:294:28: note: in expansion of macro ‘g_strdup’
/usr/include/glib-2.0/glib/glist.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib/ghash.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:52: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/storage_file/storage_source_backingstore.c: scope_hint: In function ‘virStorageSourceParseNBDColonString’
/usr/include/glib-2.0/glib/gmem.h:335:57: note: in expansion of macro ‘_G_NEW’
libvirt-10.9.0-build/libvirt-10.9.0/src/storage_file/storage_source_backingstore.c:300:18: note: in expansion of macro ‘g_new0’
<built-in>: note: 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): [#def150]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfirewall.c:27: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfirewall.c: scope_hint: In function ‘virFirewallNewFromRollback’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/viralloc.h:116:5: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfirewall.c:225:9: note: in expansion of macro ‘VIR_RESIZE_N’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfirewall.c:996:17: note: in expansion of macro ‘ADD_ARG’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfirewall.c:483:5: note: in expansion of macro ‘VIR_FIREWALL_RETURN_IF_ERROR’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfirewall.c:483:5: note: in expansion of macro ‘VIR_FIREWALL_RETURN_IF_ERROR’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfirewall.c:993:37: note: in expansion of macro ‘virFirewallAddCmd’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfirewall.c:243:5: note: in expansion of macro ‘VIR_FIREWALL_RETURN_NULL_IF_ERROR’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfirewall.c:243:5: note: in expansion of macro ‘VIR_FIREWALL_RETURN_NULL_IF_ERROR’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfirewall.c:993:37: note: in expansion of macro ‘virFirewallAddCmd’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfirewall.c:225:9: note: in expansion of macro ‘VIR_RESIZE_N’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfirewall.c:996:17: note: in expansion of macro ‘ADD_ARG’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfirewall.c:225:9: note: in expansion of macro ‘VIR_RESIZE_N’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfirewall.c:996:17: note: in expansion of macro ‘ADD_ARG’
#  114|    */
#  115|   #define VIR_RESIZE_N(ptr, alloc, count, add) \
#  116|->     virResizeN(&(ptr), sizeof(*(ptr)), &(alloc), count, add)
#  117|   
#  118|   /**

Error: GCC_ANALYZER_WARNING (CWE-775): [#def151]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/vircgroup.c: scope_hint: In function ‘virCgroupDetectPlacement’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/vircgroup.c:353:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(procfile, "r")’
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/glibcompat.h:21: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:30: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virbitmap.h:24: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/vircgroup.h:24: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/vircgrouppriv.h:28: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/vircgroup.c:36: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/vircgroup.c:348:20: note: in expansion of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/vircgroup.c: scope_hint: In function ‘virCgroupDetectPlacement’
#  351|       }
#  352|   
#  353|->     mapping = fopen(procfile, "r");
#  354|       if (mapping == NULL) {
#  355|           virReportSystemError(errno,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def152]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/vircgroup.c:353:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(procfile, "r")’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/vircgroup.c:348:20: note: in expansion of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/vircgroup.c: scope_hint: In function ‘virCgroupDetectPlacement’
#  351|       }
#  352|   
#  353|->     mapping = fopen(procfile, "r");
#  354|       if (mapping == NULL) {
#  355|           virReportSystemError(errno,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def153]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/vircgroup.c: scope_hint: In function ‘virCgroupKillInternal’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/vircgroup.c:2672:20: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(keypath, "r")’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/vircgrouppriv.h:29: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/vircgroup.c:1515:5: note: in expansion of macro ‘VIR_CGROUP_BACKEND_CALL’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/vircgroup.c:1515:5: note: in expansion of macro ‘VIR_CGROUP_BACKEND_CALL’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/vircgroup.c:1515:5: note: in expansion of macro ‘VIR_CGROUP_BACKEND_CALL’
# 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): [#def154]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/vircgroup.c:2672:20: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(keypath, "r")’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/vircgroup.c:1515:5: note: in expansion of macro ‘VIR_CGROUP_BACKEND_CALL’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/vircgroup.c:1515:5: note: in expansion of macro ‘VIR_CGROUP_BACKEND_CALL’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/vircgroup.c:1515:5: note: in expansion of macro ‘VIR_CGROUP_BACKEND_CALL’
# 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): [#def155]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/vircgroupv1.c: scope_hint: In function ‘virCgroupV1ResolveMountLink’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/vircgroupv1.c:230:15: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/glibcompat.h:21: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:30: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/vircgroupv1.c:30: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/vircgroupv1.c:228:11: note: in expansion of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/vircgroupv1.c: scope_hint: In function ‘virCgroupV1ResolveMountLink’
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:28: included_from: Included from here.
/usr/include/string.h:273:14: note: argument 1 of ‘strrchr’ must be non-null
#  228|       tmp = g_strdup(mntDir);
#  229|   
#  230|->     dirName = strrchr(tmp, '/');
#  231|       if (!dirName) {
#  232|           virReportError(VIR_ERR_INTERNAL_ERROR,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def156]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virdaemon.c: scope_hint: In function ‘virDaemonForkIntoBackground’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virdaemon.c:66:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(stdinfd, 0)’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virdaemon.c: scope_hint: In function ‘virDaemonForkIntoBackground’
#   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): [#def157]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virdaemon.c:68:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(stdoutfd, 1)’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virdaemon.c: scope_hint: In function ‘virDaemonForkIntoBackground’
#   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): [#def158]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virdaemon.c:70:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(stdoutfd, 2)’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virdaemon.c: scope_hint: In function ‘virDaemonForkIntoBackground’
#   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): [#def159]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virdnsmasq.c: scope_hint: In function ‘addnhostsWrite’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virdnsmasq.c:174:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(g_strdup_printf("%s.new", path), "w")’
#  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): [#def160]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virdnsmasq.c:174:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(g_strdup_printf("%s.new", path), "w")’
#  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): [#def161]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virdnsmasq.c:176:19: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "w")’
#  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): [#def162]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virdnsmasq.c:176:19: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "w")’
#  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): [#def163]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virdnsmasq.c: scope_hint: In function ‘hostsfileWrite’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virdnsmasq.c:366:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(g_strdup_printf("%s.new", path), "w")’
#  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): [#def164]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virdnsmasq.c:366:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(g_strdup_printf("%s.new", path), "w")’
#  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): [#def165]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virdnsmasq.c:368:19: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "w")’
#  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): [#def166]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virdnsmasq.c:368:19: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "w")’
#  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): [#def167]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfdstream.c: scope_hint: In function ‘virFDStreamOpenFileInternal’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfdstream.c:1341:9: warning[-Wanalyzer-null-argument]: use of NULL ‘path’ where non-null expected
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfdstream.c: scope_hint: In function ‘virFDStreamOpenFileInternal’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfdstream.c:25: included_from: Included from here.
/usr/include/glib-2.0/glib/glist.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib/ghash.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:52: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/glibcompat.h:21: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:30: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfdstream.h:24: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfdstream.c:32: included_from: Included from here.
/usr/include/glib-2.0/glib/gmem.h:335:57: note: in expansion of macro ‘_G_NEW’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfdstream.c:1307:22: note: in expansion of macro ‘g_new0’
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfdstream.c:1325:37: note: in expansion of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfdstream.c: scope_hint: In function ‘virFDStreamOpenFileInternal’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfdstream.c:27: included_from: Included from here.
/usr/include/unistd.h:858:12: note: argument 1 of ‘unlink’ must be non-null
# 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): [#def168]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfile.c: scope_hint: In function ‘virFileMakeParentPath’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfile.c:3243:14: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/glibcompat.h:21: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:30: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfile.c:26: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfile.c:3241:11: note: in expansion of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfile.c: scope_hint: In function ‘virFileMakeParentPath’
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:28: included_from: Included from here.
/usr/include/string.h:273:14: note: argument 1 of ‘strrchr’ must be non-null
# 3241|       tmp = g_strdup(path);
# 3242|   
# 3243|->     if ((p = strrchr(tmp, '/')) == NULL) {
# 3244|           errno = EINVAL;
# 3245|           return -1;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def169]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfile.c: scope_hint: In function ‘virFileSanitizePath’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfile.c:3370:16: warning[-Wanalyzer-null-argument]: use of NULL ‘path’ where non-null expected
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfile.c:3366:17: note: in expansion of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfile.c: scope_hint: In function ‘virFileSanitizePath’
<built-in>: note: 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): [#def170]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfile.c: scope_hint: In function ‘virFileIsSharedFSType’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfile.c:3586:18: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfile.c:3584:15: note: in expansion of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfile.c: scope_hint: In function ‘virFileIsSharedFSType’
/usr/include/features.h:511: included_from: Included from here.
/usr/include/errno.h:25: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:23: included_from: Included from here.
/usr/include/sys/statfs.h:35:12: note: argument 1 of ‘statfs’ must be non-null
# 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): [#def171]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfile.c: scope_hint: In function ‘virFileGetHugepageSize’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfile.c:3643:9: warning[-Wanalyzer-null-argument]: use of NULL ‘path’ where non-null expected
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:92:30: note: in definition of macro ‘STRNEQ’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfile.c:3729:24: note: in expansion of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfile.c: scope_hint: In function ‘virFileGetHugepageSize’
/usr/include/sys/statfs.h:35:12: note: argument 1 of ‘statfs’ must be non-null
# 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): [#def172]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfirewall.c: scope_hint: In function ‘virFirewallCmdToString’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfirewall.c:547:26: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘fwCmd’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfirewall.c:30: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virlog.h:88:5: note: in expansion of macro ‘VIR_DEBUG_INT’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfirewall.c:911:5: note: in expansion of macro ‘VIR_DEBUG’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfirewall.h:23: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfirewall.c:25: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:90:29: note: in definition of macro ‘STREQ’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfirewall.c:686:13: note: in expansion of macro ‘VIR_NFTABLES_ARG_IS_CREATE’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfirewall.c:243:5: note: in expansion of macro ‘VIR_FIREWALL_RETURN_NULL_IF_ERROR’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfirewall.c:243:5: note: in expansion of macro ‘VIR_FIREWALL_RETURN_NULL_IF_ERROR’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfirewall.c:444:5: note: in expansion of macro ‘VIR_FIREWALL_CMD_RETURN_IF_ERROR’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfirewall.c:444:5: note: in expansion of macro ‘VIR_FIREWALL_CMD_RETURN_IF_ERROR’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfirewall.c:444:5: note: in expansion of macro ‘VIR_FIREWALL_CMD_RETURN_IF_ERROR’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfirewall.c:444:5: note: in expansion of macro ‘VIR_FIREWALL_CMD_RETURN_IF_ERROR’
#  545|   
#  546|       virBufferAdd(&buf, cmd, -1);
#  547|->     for (i = 0; i < fwCmd->argsLen; i++) {
#  548|           virBufferAddLit(&buf, " ");
#  549|           virBufferAdd(&buf, fwCmd->args[i], -1);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def173]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virhostmem.c: scope_hint: In function ‘virHostMemGetStats’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virhostmem.c:286:19: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(meminfo_path, "r")’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virhostmem.h:24: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virhostmem.c:39: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virhostmem.c:253:5: note: in expansion of macro ‘virCheckFlags’
#  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): [#def174]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virhostmem.c:286:19: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(meminfo_path, "r")’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virhostmem.c:253:5: note: in expansion of macro ‘virCheckFlags’
#  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): [#def175]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virlockspace.c: scope_hint: In function ‘virLockSpaceResourceFree’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virlockspace.c:94:17: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/glibcompat.h:21: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:30: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virlockspace.h:24: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virlockspace.c:24: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virlockspace.c:124:17: note: in expansion of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virlockspace.c: scope_hint: In function ‘virLockSpaceResourceFree’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virlockspace.c:69:15: note: in expansion of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virlockspace.c: scope_hint: In function ‘virLockSpaceResourceFree’
/usr/include/bits/sigstksz.h:24: included_from: Included from here.
/usr/include/signal.h:328: included_from: Included from here.
/usr/include/glib-2.0/glib/gbacktrace.h:38: included_from: Included from here.
/usr/include/glib-2.0/glib.h:36: included_from: Included from here.
/usr/include/unistd.h:858:12: note: argument 1 of ‘unlink’ must be non-null
#   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): [#def176]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virmdev.c: scope_hint: In function ‘virMediatedDeviceIsUsed’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virmdev.c:400:51: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dev’
#  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): [#def177]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virobject.c: scope_hint: In function ‘virClassIsDerivedFrom’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virobject.c:226:35: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘parent’
#  224|   {
#  225|       while (klass) {
#  226|->         if (klass->magic == parent->magic)
#  227|               return true;
#  228|           klass = klass->parent;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def178]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virpcivpd.c: scope_hint: In function ‘virPCIVPDResourceIsValidTextValue’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virpcivpd.c:181:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘v’
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/glibcompat.h:21: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:30: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virthread.h:24: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virpcivpd.c:29: included_from: Included from here.
/usr/include/glib-2.0/glib/gstrfuncs.h:324:38: note: in definition of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virpcivpd.c:578:25: note: in expansion of macro ‘g_strstrip’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virpcivpd.c:578:16: note: in expansion of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virpcivpd.c: scope_hint: In function ‘virPCIVPDResourceIsValidTextValue’
#  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): [#def179]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virrotatingfile.c: scope_hint: In function ‘virRotatingFileWriterDelete’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virrotatingfile.c:183:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/glibcompat.h:21: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:30: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virrotatingfile.h:24: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virrotatingfile.c:28: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virrotatingfile.c:239:22: note: in expansion of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virrotatingfile.c: scope_hint: In function ‘virRotatingFileWriterDelete’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virrotatingfile.c:26: included_from: Included from here.
/usr/include/unistd.h:858:12: note: argument 1 of ‘unlink’ must be non-null
#  181|       size_t i;
#  182|   
#  183|->     if (unlink(file->basepath) < 0 &&
#  184|           errno != ENOENT) {
#  185|           virReportSystemError(errno,

Error: GCC_ANALYZER_WARNING (CWE-457): [#def180]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virsocketaddr.c: scope_hint: In function ‘virSocketAddrGetRange’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virsocketaddr.c:1020:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘t2[7]’
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/glibcompat.h:21: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:30: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virsocket.h:21: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virsocketaddr.h:21: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virsocketaddr.c:21: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virsocketaddr.c:487:23: note: in expansion of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virsocketaddr.c: scope_hint: In function ‘virSocketAddrGetRange’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virsocketaddr.c:487:23: note: in expansion of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virsocketaddr.c: scope_hint: In function ‘virSocketAddrGetRange’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virsocketaddr.c:895:9: note: in expansion of macro ‘VIR_SOCKET_ADDR_FAMILY’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virsocketaddr.c:968:9: note: in expansion of macro ‘VIR_SOCKET_ADDR_IS_FAMILY’
# 1018|               }
# 1019|           }
# 1020|->         ret = t2[7] - t1[7];
# 1021|           if (ret < 0) {
# 1022|               virReportError(VIR_ERR_INTERNAL_ERROR,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def181]
libvirt-10.9.0-build/libvirt-10.9.0/src/libxl/libxl_logger.c:29: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virthread.h:214:38: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(g_strdup_printf("%s/%s.log", *logger.logDir,  name), "a")’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virthread.h:232:5: note: in expansion of macro ‘VIR_WITH_MUTEX_LOCK_GUARD_’
libvirt-10.9.0-build/libvirt-10.9.0/src/libxl/libxl_logger.c:198:5: note: in expansion of macro ‘VIR_WITH_MUTEX_LOCK_GUARD’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virthread.h:232:5: note: in expansion of macro ‘VIR_WITH_MUTEX_LOCK_GUARD_’
libvirt-10.9.0-build/libvirt-10.9.0/src/libxl/libxl_logger.c:198:5: note: in expansion of macro ‘VIR_WITH_MUTEX_LOCK_GUARD’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virthread.h:232:5: note: in expansion of macro ‘VIR_WITH_MUTEX_LOCK_GUARD_’
libvirt-10.9.0-build/libvirt-10.9.0/src/libxl/libxl_logger.c:198:5: note: in expansion of macro ‘VIR_WITH_MUTEX_LOCK_GUARD’
#  212|   
#  213|   #define VIR_WITH_MUTEX_LOCK_GUARD_(m, name) \
#  214|->     for (g_auto(virLockGuard) name = virLockGuardLock(m); name.mutex; \
#  215|           name.mutex = (virLockGuardUnlock(&name), NULL))
#  216|   /**

Error: GCC_ANALYZER_WARNING (CWE-401): [#def182]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virthread.h:214:38: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(g_strdup_printf("%s/%s.log", *logger.logDir,  name), "a")’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virthread.h:232:5: note: in expansion of macro ‘VIR_WITH_MUTEX_LOCK_GUARD_’
libvirt-10.9.0-build/libvirt-10.9.0/src/libxl/libxl_logger.c:198:5: note: in expansion of macro ‘VIR_WITH_MUTEX_LOCK_GUARD’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virthread.h:232:5: note: in expansion of macro ‘VIR_WITH_MUTEX_LOCK_GUARD_’
libvirt-10.9.0-build/libvirt-10.9.0/src/libxl/libxl_logger.c:198:5: note: in expansion of macro ‘VIR_WITH_MUTEX_LOCK_GUARD’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virthread.h:232:5: note: in expansion of macro ‘VIR_WITH_MUTEX_LOCK_GUARD_’
libvirt-10.9.0-build/libvirt-10.9.0/src/libxl/libxl_logger.c:198:5: note: in expansion of macro ‘VIR_WITH_MUTEX_LOCK_GUARD’
#  212|   
#  213|   #define VIR_WITH_MUTEX_LOCK_GUARD_(m, name) \
#  214|->     for (g_auto(virLockGuard) name = virLockGuardLock(m); name.mutex; \
#  215|           name.mutex = (virLockGuardUnlock(&name), NULL))
#  216|   /**

Error: GCC_ANALYZER_WARNING (CWE-688): [#def183]
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virutil.c: scope_hint: In function ‘virParseOwnershipIds’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virutil.c:1392:11: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/glibcompat.h:21: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:30: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virerror.h:24: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virutil.c:53: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virutil.c:1386:34: note: in expansion of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virutil.c: scope_hint: In function ‘virParseOwnershipIds’
<built-in>: note: 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): [#def184]
libvirt-10.9.0-build/libvirt-10.9.0/src/vmware/vmware_conf.c: scope_hint: In function ‘vmwareExtractPid’
libvirt-10.9.0-build/libvirt-10.9.0/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")’
#  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): [#def185]
libvirt-10.9.0-build/libvirt-10.9.0/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")’
#  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): [#def186]
libvirt-10.9.0-build/libvirt-10.9.0/tests/commandhelper.c: scope_hint: In function ‘main’
libvirt-10.9.0-build/libvirt-10.9.0/tests/commandhelper.c:55:1: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
#   53|   
#   54|       free(args);
#   55|-> }
#   56|   
#   57|   static void cleanupStringList(char ***ptr)

Error: GCC_ANALYZER_WARNING (CWE-688): [#def187]
libvirt-10.9.0-build/libvirt-10.9.0/tests/commandhelper.c:73:5: warning[-Wanalyzer-null-argument]: use of NULL ‘fopen("/builddir/build/BUILD/libvirt-10.9.0-build/libvirt-10.9.0/redhat-linux-build/tests/commandhelper.log", "w")’ where non-null expected
libvirt-10.9.0-build/libvirt-10.9.0/tests/commandhelper.c: scope_hint: In function ‘main’
/usr/include/stdio.h: scope_hint: In function ‘main’
/usr/include/stdio.h:184:12: note: argument 1 of ‘fclose’ must be non-null
#   71|   {
#   72|       FILE *file = *ptr;
#   73|->     fclose(file);
#   74|   }
#   75|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def188]
libvirt-10.9.0-build/libvirt-10.9.0/tests/commandhelper.c:73:5: warning[-Wanalyzer-null-argument]: use of NULL ‘log’ where non-null expected
libvirt-10.9.0-build/libvirt-10.9.0/tests/commandhelper.c: scope_hint: In function ‘main’
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:27: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/viralloc.h:25: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/tests/testutils.h:23: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/tests/commandhelper.c:30: included_from: Included from here.
/usr/include/stdio.h: scope_hint: In function ‘main’
/usr/include/stdio.h:184:12: note: argument 1 of ‘fclose’ must be non-null
#   71|   {
#   72|       FILE *file = *ptr;
#   73|->     fclose(file);
#   74|   }
#   75|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def189]
libvirt-10.9.0-build/libvirt-10.9.0/tests/commandhelper.c:97:19: warning[-Wanalyzer-malloc-leak]: leak of ‘parseArguments(argc,  argv)’
#   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): [#def190]
libvirt-10.9.0-build/libvirt-10.9.0/tests/commandhelper.c: scope_hint: In function ‘parseArguments’
libvirt-10.9.0-build/libvirt-10.9.0/tests/commandhelper.c:101:27: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:90:29: note: in definition of macro ‘STREQ’
#   99|               char c;
#  100|   
#  101|->             args->readfds = realloc(args->readfds,
#  102|                                       (args->numreadfds + 1) *
#  103|                                       sizeof(*args->readfds));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def191]
libvirt-10.9.0-build/libvirt-10.9.0/tests/commandhelper.c: scope_hint: In function ‘main’
libvirt-10.9.0-build/libvirt-10.9.0/tests/commandhelper.c:350:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/builddir/build/BUILD/libvirt-10.9.0-build/libvirt-10.9.0/redhat-linux-build/tests/commandhelper.log", "w")’
#  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): [#def192]
libvirt-10.9.0-build/libvirt-10.9.0/tests/commandhelper.c:350:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/builddir/build/BUILD/libvirt-10.9.0-build/libvirt-10.9.0/redhat-linux-build/tests/commandhelper.log", "w")’
#  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): [#def193]
libvirt-10.9.0-build/libvirt-10.9.0/tests/commandtest.c: scope_hint: In function ‘mymain’
libvirt-10.9.0-build/libvirt-10.9.0/tests/commandtest.c:1261:48: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(__open_alias("/dev/null", 0), 3)’
# 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): [#def194]
libvirt-10.9.0-build/libvirt-10.9.0/tests/commandtest.c:1262:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(fd, 4)’
# 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 ||
# 1264|           dup2(fd, 5) < 0 ||

Error: GCC_ANALYZER_WARNING (CWE-775): [#def195]
libvirt-10.9.0-build/libvirt-10.9.0/tests/commandtest.c:1263:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(fd, 5)’
# 1261|       if ((fd = open("/dev/null", O_RDONLY)) < 0 ||
# 1262|           dup2(fd, 3) < 0 ||
# 1263|->         dup2(fd, 4) < 0 ||
# 1264|           dup2(fd, 5) < 0 ||
# 1265|           dup2(fd, 6) < 0 ||

Error: GCC_ANALYZER_WARNING (CWE-775): [#def196]
libvirt-10.9.0-build/libvirt-10.9.0/tests/commandtest.c:1264:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(fd, 6)’
# 1262|           dup2(fd, 3) < 0 ||
# 1263|           dup2(fd, 4) < 0 ||
# 1264|->         dup2(fd, 5) < 0 ||
# 1265|           dup2(fd, 6) < 0 ||
# 1266|           dup2(fd, 7) < 0 ||

Error: GCC_ANALYZER_WARNING (CWE-775): [#def197]
libvirt-10.9.0-build/libvirt-10.9.0/tests/commandtest.c:1265:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(fd, 7)’
# 1263|           dup2(fd, 4) < 0 ||
# 1264|           dup2(fd, 5) < 0 ||
# 1265|->         dup2(fd, 6) < 0 ||
# 1266|           dup2(fd, 7) < 0 ||
# 1267|           dup2(fd, 8) < 0 ||

Error: GCC_ANALYZER_WARNING (CWE-775): [#def198]
libvirt-10.9.0-build/libvirt-10.9.0/tests/commandtest.c:1266:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(fd, 8)’
# 1264|           dup2(fd, 5) < 0 ||
# 1265|           dup2(fd, 6) < 0 ||
# 1266|->         dup2(fd, 7) < 0 ||
# 1267|           dup2(fd, 8) < 0 ||
# 1268|           (fd > 8 && VIR_CLOSE(fd) < 0)) {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def199]
libvirt-10.9.0-build/libvirt-10.9.0/tests/qemunbdkittest.c: scope_hint: In function ‘testInfoSetArgs’
libvirt-10.9.0-build/libvirt-10.9.0/tests/qemunbdkittest.c:168:1: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
#  166|           }
#  167|       }
#  168|-> }
#  169|   
#  170|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def200]
libvirt-10.9.0-build/libvirt-10.9.0/tests/securityselinuxlabeltest.c: scope_hint: In function ‘testSELinuxLoadFileList’
libvirt-10.9.0-build/libvirt-10.9.0/tests/securityselinuxlabeltest.c:107:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(g_strdup_printf("%s/securityselinuxlabeldata/%s.txt", "/builddir/build/BUILD/libvirt-10.9.0-build/libvirt-10.9.0/tests", testname), "r")’
#  105|                              testname);
#  106|   
#  107|->     if (!(fp = fopen(path, "r")))
#  108|           return -1;
#  109|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def201]
libvirt-10.9.0-build/libvirt-10.9.0/tests/securityselinuxlabeltest.c:107:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(g_strdup_printf("%s/securityselinuxlabeldata/%s.txt", "/builddir/build/BUILD/libvirt-10.9.0-build/libvirt-10.9.0/tests", testname), "r")’
#  105|                              testname);
#  106|   
#  107|->     if (!(fp = fopen(path, "r")))
#  108|           return -1;
#  109|   

Error: GCC_ANALYZER_WARNING (CWE-127): [#def202]
libvirt-10.9.0-build/libvirt-10.9.0/tests/testutils.c: scope_hint: In function ‘virTestDifferenceFullInternal’
libvirt-10.9.0-build/libvirt-10.9.0/tests/testutils.c:413:30: warning[-Wanalyzer-out-of-bounds]: buffer under-read
/usr/lib64/glib-2.0/include/glibconfig.h:9: included_from: Included from here.
/usr/include/glib-2.0/glib/gtypes.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib/galloca.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib.h:32: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/glibcompat.h:21: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:30: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/viralloc.h:25: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/tests/testutils.h:23: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/tests/testutils.c:29: included_from: Included from here.
/usr/include/glib-2.0/glib/gmacros.h:1365:7: note: in expansion of macro ‘_GLIB_AUTOPTR_CLEAR_FUNC_NAME’
/usr/include/glib-2.0/glib/gmacros.h:1381:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfile.h:103:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
/usr/include/glib-2.0/glib/gmacros.h:1381:3: note: in expansion of macro ‘_GLIB_DEFINE_AUTOPTR_CLEANUP_FUNCS’
libvirt-10.9.0-build/libvirt-10.9.0/src/util/virfile.h:103:1: note: in expansion of macro ‘G_DEFINE_AUTOPTR_CLEANUP_FUNC’
libvirt-10.9.0-build/libvirt-10.9.0/tests/testutils.c:413:30: note: valid subscripts for ‘""’ are ‘[0]’ to ‘[0]’
#  411|           while (actualEnd > actualStart &&
#  412|                  expectEnd > expectStart &&
#  413|->                *actualEnd == *expectEnd) {
#  414|               actualEnd--;
#  415|               expectEnd--;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def203]
libvirt-10.9.0-build/libvirt-10.9.0/tests/testutilsqemu.c: scope_hint: In function ‘testQemuInfoSetArgs’
libvirt-10.9.0-build/libvirt-10.9.0/tests/testutilsqemu.c:720:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup(fakefd)’
#  718|                   }
#  719|   
#  720|->                 if ((new->fds[i] = dup(fakefd)) < 0) {
#  721|                       fprintf(stderr, "failed to duplicate fake fd: %s",
#  722|                               g_strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-688): [#def204]
libvirt-10.9.0-build/libvirt-10.9.0/tests/testutilsqemu.c: scope_hint: In function ‘testQemuGetRealCapsInternal’
libvirt-10.9.0-build/libvirt-10.9.0/tests/testutilsqemu.c:804:14: warning[-Wanalyzer-null-argument]: use of NULL ‘capsfile’ where non-null expected
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/glibcompat.h:21: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:30: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/conf/capabilities.h:24: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/tests/testutilsqemu.h:21: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/tests/testutilsqemu.c:4: included_from: Included from here.
/usr/include/glib-2.0/glib/gstrfuncs.h:324:38: note: in definition of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/tests/testutilsqemu.c:783:20: note: in expansion of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/tests/testutilsqemu.c: scope_hint: In function ‘testQemuGetRealCapsInternal’
libvirt-10.9.0-build/libvirt-10.9.0/tests/testutilsqemu.c: scope_hint: In function ‘testQemuGetRealCapsInternal’
<built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null
#  802|   
#  803|       /* strip 'xml' suffix so that we can format the file to '.replies' */
#  804|->     capsfile[strlen(capsfile) - 3] = '\0';
#  805|   
#  806|       if (schemaCache && schema) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def205]
libvirt-10.9.0-build/libvirt-10.9.0/tests/virhostcputest.c: scope_hint: In function ‘linuxTestCompareFiles’
libvirt-10.9.0-build/libvirt-10.9.0/tests/virhostcputest.c:36:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(cpuinfofile, "r")’
#   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): [#def206]
libvirt-10.9.0-build/libvirt-10.9.0/tests/virhostcputest.c:36:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(cpuinfofile, "r")’
#   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): [#def207]
libvirt-10.9.0-build/libvirt-10.9.0/tests/virhostcputest.c: scope_hint: In function ‘linuxCPUStatsCompareFiles’
libvirt-10.9.0-build/libvirt-10.9.0/tests/virhostcputest.c:110:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(cpustatfile, "r")’
#  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): [#def208]
libvirt-10.9.0-build/libvirt-10.9.0/tests/virhostcputest.c:110:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(cpustatfile, "r")’
#  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): [#def209]
libvirt-10.9.0-build/libvirt-10.9.0/tests/virhostcputest.c: scope_hint: In function ‘hostCPUSignature’
libvirt-10.9.0-build/libvirt-10.9.0/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-10.9.0-build/libvirt-10.9.0/tests", virArchToString(*(const struct linuxTestHostCPUData *)opaque.arch), *(const struct linuxTestHostCPUData *)opaque.testName), "r")’
#  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): [#def210]
libvirt-10.9.0-build/libvirt-10.9.0/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-10.9.0-build/libvirt-10.9.0/tests", virArchToString(*(const struct linuxTestHostCPUData *)opaque.arch), *(const struct linuxTestHostCPUData *)opaque.testName), "r")’
#  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): [#def211]
libvirt-10.9.0-build/libvirt-10.9.0/tests/virnetdaemontest.c: scope_hint: In function ‘testExecRestart’
libvirt-10.9.0-build/libvirt-10.9.0/tests/virnetdaemontest.c:293:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(fdserver[0], 100)’
#  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): [#def212]
libvirt-10.9.0-build/libvirt-10.9.0/tests/virnetdaemontest.c:293:36: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(fdserver[1], 101)’
#  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): [#def213]
libvirt-10.9.0-build/libvirt-10.9.0/tests/virnetdaemontest.c:294:36: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(fdclient[0], 102)’
#  292|        */
#  293|       if (dup2(fdserver[0], 100) < 0 ||
#  294|->         dup2(fdserver[1], 101) < 0 ||
#  295|           dup2(fdclient[0], 102) < 0 ||
#  296|           dup2(fdclient[1], 103) < 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def214]
libvirt-10.9.0-build/libvirt-10.9.0/tests/virnetdaemontest.c:295:36: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(fdclient[1], 103)’
#  293|       if (dup2(fdserver[0], 100) < 0 ||
#  294|           dup2(fdserver[1], 101) < 0 ||
#  295|->         dup2(fdclient[0], 102) < 0 ||
#  296|           dup2(fdclient[1], 103) < 0) {
#  297|           virReportSystemError(errno, "%s", "dup2() failed");

Error: GCC_ANALYZER_WARNING (CWE-476): [#def215]
libvirt-10.9.0-build/libvirt-10.9.0/tools/virsh-completer-checkpoint.c: scope_hint: In function ‘virshCheckpointNameCompleter’
libvirt-10.9.0-build/libvirt-10.9.0/tools/virsh-completer-checkpoint.c:69:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
libvirt-10.9.0-build/libvirt-10.9.0/tools/vsh.h:28: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/tools/virsh-completer-checkpoint.h:23: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/tools/virsh-completer-checkpoint.c:23: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/tools/virsh-completer-checkpoint.c:39:5: note: in expansion of macro ‘virCheckFlags’
#   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-688): [#def216]
libvirt-10.9.0-build/libvirt-10.9.0/tools/virsh-domain.c: scope_hint: In function ‘virshAddressParse’
libvirt-10.9.0-build/libvirt-10.9.0/tools/virsh-domain.c:125:15: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/glibcompat.h:21: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:30: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/tools/virsh.h:25: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/tools/virsh-domain.h:23: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/tools/virsh-domain.c:22: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/tools/virsh-domain.c:124:29: note: in expansion of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/tools/virsh-domain.c: scope_hint: In function ‘virshAddressParse’
<built-in>: note: 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): [#def217]
libvirt-10.9.0-build/libvirt-10.9.0/tools/virsh-domain.c: scope_hint: In function ‘getSignalNumber’
libvirt-10.9.0-build/libvirt-10.9.0/tools/virsh-domain.c:8652:24: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘signame’
libvirt-10.9.0-build/libvirt-10.9.0/tools/virsh-domain.c:8649:28: note: in expansion of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/tools/virsh-domain.c: scope_hint: In function ‘getSignalNumber’
# 8650|       char *p = str;
# 8651|   
# 8652|->     for (i = 0; signame[i]; i++)
# 8653|           p[i] = g_ascii_tolower(signame[i]);
# 8654|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def218]
libvirt-10.9.0-build/libvirt-10.9.0/tools/virsh-secret.c: scope_hint: In function ‘cmdSecretSetValue’
libvirt-10.9.0-build/libvirt-10.9.0/tools/virsh-secret.c:240:22: warning[-Wanalyzer-null-argument]: use of NULL ‘secret_val’ where non-null expected
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:69: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/tools/vsh.h:28: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/tools/virsh-secret.h:23: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/tools/virsh-secret.c:22: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/tools/virsh-secret.c:238:23: note: in expansion of macro ‘_’
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/glibcompat.h:21: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:30: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/tools/virsh-secret.c:239:22: note: in expansion of macro ‘g_strdup’
libvirt-10.9.0-build/libvirt-10.9.0/tools/virsh-secret.c: scope_hint: In function ‘cmdSecretSetValue’
<built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null
#  238|           vshError(ctl, _("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): [#def219]
libvirt-10.9.0-build/libvirt-10.9.0/tools/virsh-volume.c: scope_hint: In function ‘cmdVolList’
libvirt-10.9.0-build/libvirt-10.9.0/tools/virsh-volume.c:1381:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘volInfoTexts’
# 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): [#def220]
libvirt-10.9.0-build/libvirt-10.9.0/tools/virsh-volume.c:1404:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘volInfoTexts’
# 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-775): [#def221]
libvirt-10.9.0-build/libvirt-10.9.0/tools/virt-host-validate-common.c: scope_hint: In function ‘virHostValidateGetCPUFlags’
libvirt-10.9.0-build/libvirt-10.9.0/tools/virt-host-validate-common.c:112:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/proc/cpuinfo", "r")’
#  110|       size_t linelen = 0;
#  111|   
#  112|->     if (!(fp = fopen("/proc/cpuinfo", "r")))
#  113|           return NULL;
#  114|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def222]
libvirt-10.9.0-build/libvirt-10.9.0/tools/virt-host-validate-common.c:112:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/proc/cpuinfo", "r")’
#  110|       size_t linelen = 0;
#  111|   
#  112|->     if (!(fp = fopen("/proc/cpuinfo", "r")))
#  113|           return NULL;
#  114|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def223]
libvirt-10.9.0-build/libvirt-10.9.0/tools/vsh.c: scope_hint: In function ‘vshCommandOptArgvString’
libvirt-10.9.0-build/libvirt-10.9.0/tools/vsh.c:1283:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘opt’
/usr/include/bits/types/struct_iovec.h:23: included_from: Included from here.
/usr/include/bits/fcntl-linux.h:38: included_from: Included from here.
/usr/include/bits/fcntl.h:61: included_from: Included from here.
/usr/include/fcntl.h:35: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/tools/vsh.c:27: included_from: Included from here.
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/util/glibcompat.h:21: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/src/internal.h:30: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/tools/vsh.h:28: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/tools/vsh.c:22: included_from: Included from here.
libvirt-10.9.0-build/libvirt-10.9.0/tools/vsh.c:3539:28: note: in expansion of macro ‘g_strdup’
# 1281|           return NULL;
# 1282|   
# 1283|->     if (!opt->argvstr)
# 1284|           opt->argvstr = g_strjoinv(" ", opt->argv);
# 1285|   

Scan Properties

analyzer-version-clippy1.82.0
analyzer-version-cppcheck2.16.0
analyzer-version-gcc14.2.1
analyzer-version-gcc-analyzer15.0.0
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-69.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-namelibvirt-10.9.0-1.fc42
store-results-to/tmp/tmp4_d0ste2/libvirt-10.9.0-1.fc42.tar.xz
time-created2024-11-13 01:57:44
time-finished2024-11-13 02:09:54
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmp4_d0ste2/libvirt-10.9.0-1.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmp4_d0ste2/libvirt-10.9.0-1.fc42.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9