Task #112556 - libvirt-12.2.0-2.fc45/scan-results.err
back to task #112556download
Error: SHELLCHECK_WARNING:
/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:
/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:
/usr/libexec/libvirt-guests.sh:107:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 105| # [none]: list both persistent and transient guests
# 106| list_guests() {
# 107|-> local uri="$1"
# 108| local persistent="$2"
# 109| local list
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:108:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 106| list_guests() {
# 107| local uri="$1"
# 108|-> local persistent="$2"
# 109| local list
# 110|
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:109:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 107| local uri="$1"
# 108| local persistent="$2"
# 109|-> local list
# 110|
# 111| list="$(run_virsh_c "$uri" list --uuid $persistent)"
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:123:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 121| # return name of guest UUID on URI
# 122| guest_name() {
# 123|-> local uri="$1"
# 124| local uuid="$2"
# 125|
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:124:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 122| guest_name() {
# 123| local uri="$1"
# 124|-> local uuid="$2"
# 125|
# 126| run_virsh "$uri" domname "$uuid" 2>/dev/null
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:133:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 131| # Result is returned by variable "guest_running"
# 132| guest_is_on() {
# 133|-> local uri="$1"
# 134| local uuid="$2"
# 135| local id
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:134:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 132| guest_is_on() {
# 133| local uri="$1"
# 134|-> local uuid="$2"
# 135| local id
# 136|
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:135:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 133| local uri="$1"
# 134| local uuid="$2"
# 135|-> local id
# 136|
# 137| guest_running="false"
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:157:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 155| # Start or resume the guests
# 156| start() {
# 157|-> local isfirst="true"
# 158| local bypass=
# 159| local sync_time="false"
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:158:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 156| start() {
# 157| local isfirst="true"
# 158|-> local bypass=
# 159| local sync_time="false"
# 160| local uri=
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:159:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 157| local isfirst="true"
# 158| local bypass=
# 159|-> local sync_time="false"
# 160| local uri=
# 161| local list=
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:160:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 158| local bypass=
# 159| local sync_time="false"
# 160|-> local uri=
# 161| local list=
# 162|
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:161:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 159| local sync_time="false"
# 160| local uri=
# 161|-> local list=
# 162|
# 163| [ -f "$LISTFILE" ] || { started; return 0; }
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:176:9: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 174| test "x$SYNC_TIME" = x0 || sync_time="true"
# 175| while read uri list; do
# 176|-> local configured="false"
# 177| local confuri=
# 178| local guest=
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:177:9: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 175| while read uri list; do
# 176| local configured="false"
# 177|-> local confuri=
# 178| local guest=
# 179|
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:178:9: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 176| local configured="false"
# 177| local confuri=
# 178|-> local guest=
# 179|
# 180| set -f
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:198:13: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 196| eval_gettext "Resuming guests on \$uri URI..."; echo
# 197| for guest in $list; do
# 198|-> local name="$(guest_name "$uri" "$guest")"
# 199| eval_gettext "Resuming guest \$name: "
# 200| if guest_is_on "$uri" "$guest"; then
Error: SHELLCHECK_WARNING (CWE-571):
/usr/libexec/libvirt-guests.sh:198:19: warning[SC2155]: Declare and assign separately to avoid masking return values.
# 196| eval_gettext "Resuming guests on \$uri URI..."; echo
# 197| for guest in $list; do
# 198|-> local name="$(guest_name "$uri" "$guest")"
# 199| eval_gettext "Resuming guest \$name: "
# 200| if guest_is_on "$uri" "$guest"; then
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:229:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 227| suspend_guest()
# 228| {
# 229|-> local uri="$1"
# 230| local guest="$2"
# 231| local name="$(guest_name "$uri" "$guest")"
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:230:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 228| {
# 229| local uri="$1"
# 230|-> local guest="$2"
# 231| local name="$(guest_name "$uri" "$guest")"
# 232| local label="$(eval_gettext "Suspending \$name: ")"
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:231:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 229| local uri="$1"
# 230| local guest="$2"
# 231|-> local name="$(guest_name "$uri" "$guest")"
# 232| local label="$(eval_gettext "Suspending \$name: ")"
# 233| local bypass=
Error: SHELLCHECK_WARNING (CWE-571):
/usr/libexec/libvirt-guests.sh:231:11: warning[SC2155]: Declare and assign separately to avoid masking return values.
# 229| local uri="$1"
# 230| local guest="$2"
# 231|-> local name="$(guest_name "$uri" "$guest")"
# 232| local label="$(eval_gettext "Suspending \$name: ")"
# 233| local bypass=
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:232:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 230| local guest="$2"
# 231| local name="$(guest_name "$uri" "$guest")"
# 232|-> local label="$(eval_gettext "Suspending \$name: ")"
# 233| local bypass=
# 234| local slept=0
Error: SHELLCHECK_WARNING (CWE-571):
/usr/libexec/libvirt-guests.sh:232:11: warning[SC2155]: Declare and assign separately to avoid masking return values.
# 230| local guest="$2"
# 231| local name="$(guest_name "$uri" "$guest")"
# 232|-> local label="$(eval_gettext "Suspending \$name: ")"
# 233| local bypass=
# 234| local slept=0
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:233:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 231| local name="$(guest_name "$uri" "$guest")"
# 232| local label="$(eval_gettext "Suspending \$name: ")"
# 233|-> local bypass=
# 234| local slept=0
# 235|
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:234:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 232| local label="$(eval_gettext "Suspending \$name: ")"
# 233| local bypass=
# 234|-> local slept=0
# 235|
# 236| test "x$BYPASS_CACHE" = x0 || bypass="--bypass-cache"
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:239:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 237| printf '%s...\n' "$label"
# 238| run_virsh "$uri" managedsave $bypass "$guest" >/dev/null &
# 239|-> local virsh_pid="$!"
# 240| while true; do
# 241| sleep 1
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:246:13: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 244| slept=$(($slept + 1))
# 245| if [ $(($slept % 5)) -eq 0 ]; then
# 246|-> local progress="$(run_virsh_c "$uri" domjobinfo "$guest" 2>/dev/null | \
# 247| awk '/^Data processed:/{print $3, $4}')"
# 248| if [ -n "$progress" ]; then
Error: SHELLCHECK_WARNING (CWE-571):
/usr/libexec/libvirt-guests.sh:246:19: warning[SC2155]: Declare and assign separately to avoid masking return values.
# 244| slept=$(($slept + 1))
# 245| if [ $(($slept % 5)) -eq 0 ]; then
# 246|-> local progress="$(run_virsh_c "$uri" domjobinfo "$guest" 2>/dev/null | \
# 247| awk '/^Data processed:/{print $3, $4}')"
# 248| if [ -n "$progress" ]; then
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:263:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 261| shutdown_guest()
# 262| {
# 263|-> local uri="$1"
# 264| local guest="$2"
# 265| local name="$(guest_name "$uri" "$guest")"
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:264:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 262| {
# 263| local uri="$1"
# 264|-> local guest="$2"
# 265| local name="$(guest_name "$uri" "$guest")"
# 266| local timeout="$SHUTDOWN_TIMEOUT"
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:265:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 263| local uri="$1"
# 264| local guest="$2"
# 265|-> local name="$(guest_name "$uri" "$guest")"
# 266| local timeout="$SHUTDOWN_TIMEOUT"
# 267| local check_timeout="false"
Error: SHELLCHECK_WARNING (CWE-571):
/usr/libexec/libvirt-guests.sh:265:11: warning[SC2155]: Declare and assign separately to avoid masking return values.
# 263| local uri="$1"
# 264| local guest="$2"
# 265|-> local name="$(guest_name "$uri" "$guest")"
# 266| local timeout="$SHUTDOWN_TIMEOUT"
# 267| local check_timeout="false"
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:266:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 264| local guest="$2"
# 265| local name="$(guest_name "$uri" "$guest")"
# 266|-> local timeout="$SHUTDOWN_TIMEOUT"
# 267| local check_timeout="false"
# 268| local format=
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:267:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 265| local name="$(guest_name "$uri" "$guest")"
# 266| local timeout="$SHUTDOWN_TIMEOUT"
# 267|-> local check_timeout="false"
# 268| local format=
# 269| local slept=
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:268:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 266| local timeout="$SHUTDOWN_TIMEOUT"
# 267| local check_timeout="false"
# 268|-> local format=
# 269| local slept=
# 270|
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:269:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 267| local check_timeout="false"
# 268| local format=
# 269|-> local slept=
# 270|
# 271| eval_gettext "Starting shutdown on guest: \$name"
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:315:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 313| shutdown_guest_async()
# 314| {
# 315|-> local uri="$1"
# 316| local guest="$2"
# 317| local name="$(guest_name "$uri" "$guest")"
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:316:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 314| {
# 315| local uri="$1"
# 316|-> local guest="$2"
# 317| local name="$(guest_name "$uri" "$guest")"
# 318|
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:317:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 315| local uri="$1"
# 316| local guest="$2"
# 317|-> local name="$(guest_name "$uri" "$guest")"
# 318|
# 319| eval_gettext "Starting shutdown on guest: \$name"
Error: SHELLCHECK_WARNING (CWE-571):
/usr/libexec/libvirt-guests.sh:317:11: warning[SC2155]: Declare and assign separately to avoid masking return values.
# 315| local uri="$1"
# 316| local guest="$2"
# 317|-> local name="$(guest_name "$uri" "$guest")"
# 318|
# 319| eval_gettext "Starting shutdown on guest: \$name"
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:338:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 336| check_guests_shutdown()
# 337| {
# 338|-> local uri="$1"
# 339| local guests_to_check="$2"
# 340| local guest=
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:339:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 337| {
# 338| local uri="$1"
# 339|-> local guests_to_check="$2"
# 340| local guest=
# 341|
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:340:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 338| local uri="$1"
# 339| local guests_to_check="$2"
# 340|-> local guest=
# 341|
# 342| guests_shutting_down=
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:360:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 358| print_guests_shutdown()
# 359| {
# 360|-> local uri="$1"
# 361| local before="$2"
# 362| local after="$3"
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:361:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 359| {
# 360| local uri="$1"
# 361|-> local before="$2"
# 362| local after="$3"
# 363| local guest=
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:362:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 360| local uri="$1"
# 361| local before="$2"
# 362|-> local after="$3"
# 363| local guest=
# 364|
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:363:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 361| local before="$2"
# 362| local after="$3"
# 363|-> local guest=
# 364|
# 365| for guest in $before; do
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:370:9: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 368| esac
# 369|
# 370|-> local name="$(guest_name "$uri" "$guest")"
# 371| if [ -n "$name" ]; then
# 372| eval_gettext "Shutdown of guest \$name complete."
Error: SHELLCHECK_WARNING (CWE-571):
/usr/libexec/libvirt-guests.sh:370:15: warning[SC2155]: Declare and assign separately to avoid masking return values.
# 368| esac
# 369|
# 370|-> local name="$(guest_name "$uri" "$guest")"
# 371| if [ -n "$name" ]; then
# 372| eval_gettext "Shutdown of guest \$name complete."
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:382:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 380| shutdown_guests_parallel()
# 381| {
# 382|-> local uri="$1"
# 383| local guests="$2"
# 384| local on_shutdown=
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:383:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 381| {
# 382| local uri="$1"
# 383|-> local guests="$2"
# 384| local on_shutdown=
# 385| local check_timeout="false"
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:384:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 382| local uri="$1"
# 383| local guests="$2"
# 384|-> local on_shutdown=
# 385| local check_timeout="false"
# 386| local timeout="$SHUTDOWN_TIMEOUT"
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:385:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 383| local guests="$2"
# 384| local on_shutdown=
# 385|-> local check_timeout="false"
# 386| local timeout="$SHUTDOWN_TIMEOUT"
# 387| local slept=
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:386:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 384| local on_shutdown=
# 385| local check_timeout="false"
# 386|-> local timeout="$SHUTDOWN_TIMEOUT"
# 387| local slept=
# 388| local format=
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:387:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 385| local check_timeout="false"
# 386| local timeout="$SHUTDOWN_TIMEOUT"
# 387|-> local slept=
# 388| local format=
# 389|
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:388:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 386| local timeout="$SHUTDOWN_TIMEOUT"
# 387| local slept=
# 388|-> local format=
# 389|
# 390| if [ $timeout -gt 0 ]; then
Error: SHELLCHECK_WARNING (CWE-156):
/usr/libexec/libvirt-guests.sh:399:17: warning[SC2046]: Quote this to prevent word splitting.
# 397| while [ -n "$on_shutdown" ] || [ -n "$guests" ]; do
# 398| while [ -n "$guests" ] &&
# 399|-> [ $(guest_count "$on_shutdown") -lt "$PARALLEL_SHUTDOWN" ]; do
# 400| set -- $guests
# 401| local guest="$1"
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:401:13: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 399| [ $(guest_count "$on_shutdown") -lt "$PARALLEL_SHUTDOWN" ]; do
# 400| set -- $guests
# 401|-> local guest="$1"
# 402| shift
# 403| guests="$*"
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:413:9: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 411|
# 412| set -- $guests
# 413|-> local guestcount=$#
# 414| set -- $on_shutdown
# 415| local shutdowncount=$#
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:415:9: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 413| local guestcount=$#
# 414| set -- $on_shutdown
# 415|-> local shutdowncount=$#
# 416|
# 417| if $check_timeout; then
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:434:9: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 432| fi
# 433|
# 434|-> local on_shutdown_prev="$on_shutdown"
# 435| check_guests_shutdown "$uri" "$on_shutdown"
# 436| on_shutdown="$guests_shutting_down"
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:444:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 442| # Shutdown or save guests on the configured uris
# 443| stop() {
# 444|-> local uri=
# 445| local action="suspend"
# 446| local persistent_only="default"
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:445:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 443| stop() {
# 444| local uri=
# 445|-> local action="suspend"
# 446| local persistent_only="default"
# 447|
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:446:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 444| local uri=
# 445| local action="suspend"
# 446|-> local persistent_only="default"
# 447|
# 448|
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:487:9: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 485| eval_gettext "Running guests on \$uri URI: "
# 486|
# 487|-> local list
# 488| list="$(list_guests "$uri")"
# 489| if [ $? -eq 0 ]; then
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:490:13: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 488| list="$(list_guests "$uri")"
# 489| if [ $? -eq 0 ]; then
# 490|-> local empty=true
# 491| for uuid in $list; do
# 492| "$empty" || printf ", "
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:504:13: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 502|
# 503| if "$persistent_only"; then
# 504|-> local transient
# 505| transient="$(list_guests "$uri" "--transient")"
# 506| if [ $? -eq 0 ]; then
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:507:17: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 505| transient="$(list_guests "$uri" "--transient")"
# 506| if [ $? -eq 0 ]; then
# 507|-> local empty="true"
# 508| local uuid=
# 509|
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:508:17: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 506| if [ $? -eq 0 ]; then
# 507| local empty="true"
# 508|-> local uuid=
# 509|
# 510| for uuid in $transient; do
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:560:17: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 558| shutdown_guests_parallel "$uri" "$list"
# 559| else
# 560|-> local guest=
# 561| for guest in $list; do
# 562| if [ "x$action" = xsuspend ]; then
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:580:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 578| # List status of guests
# 579| gueststatus() {
# 580|-> local uri=
# 581| set -f
# 582| for uri in $URIS; do
Error: SHELLCHECK_WARNING:
/usr/libexec/libvirt-guests.sh:612:5: warning[SC3043]: In POSIX sh, 'local' is undefined.
# 610| # Display usage string, then exit with VAL (defaults to 2).
# 611| usage() {
# 612|-> local program_name="$0"
# 613| eval_gettext "Usage: \$program_name {start|stop|status|restart|"\
# 614| "condrestart|try-restart|reload|force-reload|gueststatus|shutdown}"; echo
Error: SHELLCHECK_WARNING (CWE-563):
/usr/libexec/libvirt-guests.sh:612:11: warning[SC2034]: program_name appears unused. Verify use (or export if used externally).
# 610| # Display usage string, then exit with VAL (defaults to 2).
# 611| usage() {
# 612|-> local program_name="$0"
# 613| eval_gettext "Usage: \$program_name {start|stop|status|restart|"\
# 614| "condrestart|try-restart|reload|force-reload|gueststatus|shutdown}"; echo
Error: SHELLCHECK_WARNING (CWE-149):
/usr/libexec/libvirt-guests.sh:613:69: warning[SC2140]: Word is of the form "A"B"C" (B indicated). Did you mean "ABC" or "A\"B\"C"?
# 611| usage() {
# 612| local program_name="$0"
# 613|-> eval_gettext "Usage: \$program_name {start|stop|status|restart|"\
# 614| "condrestart|try-restart|reload|force-reload|gueststatus|shutdown}"; echo
# 615| exit ${1-2}
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/ch/ch_driver.c:1858:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘vcpuinfo’
libvirt-12.2.0/src/ch/ch_driver.c:1819:5: branch_false: following ‘false’ branch (when ‘__unsuppflags == 0’)...
libvirt-12.2.0/src/ch/ch_driver.c:1822:11: branch_false: ...to here
libvirt-12.2.0/src/ch/ch_driver.c:1824:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/ch/ch_driver.c:1827:9: branch_false: ...to here
libvirt-12.2.0/src/ch/ch_driver.c:1827:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/ch/ch_driver.c:1830:9: branch_false: ...to here
libvirt-12.2.0/src/ch/ch_driver.c:1830:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/ch/ch_driver.c:1833:9: branch_false: ...to here
libvirt-12.2.0/src/ch/ch_driver.c:1833:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/ch/ch_driver.c:1836:9: branch_false: ...to here
libvirt-12.2.0/src/ch/ch_driver.c:1836:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/ch/ch_driver.c:1844:21: branch_false: ...to here
libvirt-12.2.0/src/ch/ch_driver.c:1844:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/ch/ch_driver.c:1847:9: branch_false: ...to here
libvirt-12.2.0/src/ch/ch_driver.c:1847:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/ch/ch_driver.c:1853:9: branch_false: ...to here
libvirt-12.2.0/src/ch/ch_driver.c:1857:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/ch/ch_driver.c:1858:9: branch_true: ...to here
libvirt-12.2.0/src/ch/ch_driver.c:1858:9: danger: dereference of NULL ‘vcpuinfo’
# 1856|
# 1857| if (persistentDef) {
# 1858|-> virBitmapFree(vcpuinfo->cpumask);
# 1859| vcpuinfo->cpumask = g_steal_pointer(&pcpumap);
# 1860| goto endjob;
Error: GCC_ANALYZER_WARNING (CWE-688):
libvirt-12.2.0/src/conf/nwfilter_params.c:416:13: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-12.2.0/src/conf/nwfilter_params.c:393:1: enter_function: entry to ‘virNWFilterVarCombIterEntryAreUniqueEntries’
libvirt-12.2.0/src/conf/nwfilter_params.c:402:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/conf/nwfilter_params.c:408:13: branch_false: ...to here
libvirt-12.2.0/src/conf/nwfilter_params.c:408:13: call_function: calling ‘virNWFilterVarValueGetNthValue’ from ‘virNWFilterVarCombIterEntryAreUniqueEntries’
libvirt-12.2.0/src/conf/nwfilter_params.c:408:13: return_function: returning to ‘virNWFilterVarCombIterEntryAreUniqueEntries’ from ‘virNWFilterVarValueGetNthValue’
libvirt-12.2.0/src/conf/nwfilter_params.c:409:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/conf/nwfilter_params.c:409:8: branch_false: ...to here
libvirt-12.2.0/src/conf/nwfilter_params.c:415:17: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/conf/nwfilter_params.c:416:13: branch_true: ...to here
libvirt-12.2.0/src/conf/nwfilter_params.c:416:13: call_function: calling ‘virNWFilterVarValueGetNthValue’ from ‘virNWFilterVarCombIterEntryAreUniqueEntries’
libvirt-12.2.0/src/conf/nwfilter_params.c:416:13: return_function: returning to ‘virNWFilterVarCombIterEntryAreUniqueEntries’ from ‘virNWFilterVarValueGetNthValue’
libvirt-12.2.0/src/conf/nwfilter_params.c:415:17: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/conf/nwfilter_params.c:416:13: branch_true: ...to here
libvirt-12.2.0/src/conf/nwfilter_params.c:416:13: call_function: calling ‘virNWFilterVarValueGetNthValue’ from ‘virNWFilterVarCombIterEntryAreUniqueEntries’
libvirt-12.2.0/src/conf/nwfilter_params.c:416:13: return_function: returning to ‘virNWFilterVarCombIterEntryAreUniqueEntries’ from ‘virNWFilterVarValueGetNthValue’
libvirt-12.2.0/src/conf/nwfilter_params.c:416:13: danger: argument 2 (‘virNWFilterVarValueGetNthValue(virHashLookup(hash, *cie_28(D)->varNames), (unsigned int)i)’) NULL where non-null expected
# 414|
# 415| for (i = 0; i < cie->curValue; i++) {
# 416|-> if (STREQ(value, virNWFilterVarValueGetNthValue(varValue, i))) {
# 417| bool isSame = true;
# 418| for (j = 1; j < cie->nVarNames; j++) {
Error: GCC_ANALYZER_WARNING (CWE-688):
libvirt-12.2.0/src/conf/nwfilter_params.c:424:21: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-12.2.0/src/conf/nwfilter_params.c:393:1: enter_function: entry to ‘virNWFilterVarCombIterEntryAreUniqueEntries’
libvirt-12.2.0/src/conf/nwfilter_params.c:402:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/conf/nwfilter_params.c:408:13: branch_false: ...to here
libvirt-12.2.0/src/conf/nwfilter_params.c:408:13: call_function: calling ‘virNWFilterVarValueGetNthValue’ from ‘virNWFilterVarCombIterEntryAreUniqueEntries’
libvirt-12.2.0/src/conf/nwfilter_params.c:408:13: return_function: returning to ‘virNWFilterVarCombIterEntryAreUniqueEntries’ from ‘virNWFilterVarValueGetNthValue’
libvirt-12.2.0/src/conf/nwfilter_params.c:409:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/conf/nwfilter_params.c:409:8: branch_false: ...to here
libvirt-12.2.0/src/conf/nwfilter_params.c:415:17: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/conf/nwfilter_params.c:416:13: branch_true: ...to here
libvirt-12.2.0/src/conf/nwfilter_params.c:416:13: call_function: calling ‘virNWFilterVarValueGetNthValue’ from ‘virNWFilterVarCombIterEntryAreUniqueEntries’
libvirt-12.2.0/src/conf/nwfilter_params.c:416:13: return_function: returning to ‘virNWFilterVarCombIterEntryAreUniqueEntries’ from ‘virNWFilterVarValueGetNthValue’
libvirt-12.2.0/src/conf/nwfilter_params.c:416:12: branch_true: following ‘true’ branch (when the strings are equal)...
libvirt-12.2.0/src/conf/nwfilter_params.c:416:12: branch_true: ...to here
libvirt-12.2.0/src/conf/nwfilter_params.c:418:25: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/conf/nwfilter_params.c:419:43: branch_true: ...to here
libvirt-12.2.0/src/conf/nwfilter_params.c:420:20: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/conf/nwfilter_params.c:424:21: branch_false: ...to here
libvirt-12.2.0/src/conf/nwfilter_params.c:424:21: call_function: calling ‘virNWFilterVarValueGetNthValue’ from ‘virNWFilterVarCombIterEntryAreUniqueEntries’
libvirt-12.2.0/src/conf/nwfilter_params.c:424:21: return_function: returning to ‘virNWFilterVarCombIterEntryAreUniqueEntries’ from ‘virNWFilterVarValueGetNthValue’
libvirt-12.2.0/src/conf/nwfilter_params.c:424:21: call_function: calling ‘virNWFilterVarValueGetNthValue’ from ‘virNWFilterVarCombIterEntryAreUniqueEntries’
libvirt-12.2.0/src/conf/nwfilter_params.c:424:21: return_function: returning to ‘virNWFilterVarCombIterEntryAreUniqueEntries’ from ‘virNWFilterVarValueGetNthValue’
libvirt-12.2.0/src/conf/nwfilter_params.c:424:21: danger: argument 1 (‘virNWFilterVarValueGetNthValue(virHashLookup(hash, *<unknown>), *cie.curValue)’) NULL where non-null expected
# 422| return true;
# 423| }
# 424|-> if (STRNEQ(virNWFilterVarValueGetNthValue(tmp, cie->curValue),
# 425| virNWFilterVarValueGetNthValue(tmp, i))) {
# 426| isSame = false;
Error: GCC_ANALYZER_WARNING (CWE-688):
libvirt-12.2.0/src/conf/virchrdev.c:77:16: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-12.2.0/src/conf/virchrdev.c:66:14: enter_function: entry to ‘virChrdevLockFilePath’
libvirt-12.2.0/src/conf/virchrdev.c:77:16: danger: argument 1 (‘<unknown>’) NULL where non-null expected
# 75|
# 76| /* skip the leading "/dev/" */
# 77|-> filename = STRSKIP(devCopy, "/dev");
# 78| if (!filename)
# 79| filename = devCopy;
Error: GCC_ANALYZER_WARNING (CWE-465):
libvirt-12.2.0/src/conf/virstorageobj.c:1387:12: warning[-Wanalyzer-deref-before-check]: check of ‘obj’ for NULL after already dereferencing it
libvirt-12.2.0/src/conf/virstorageobj.c:1378:1: enter_function: entry to ‘virStoragePoolObjSourceMatchTypeDEVICE’
libvirt-12.2.0/src/conf/virstorageobj.c:1383:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/conf/virstorageobj.c:1384:13: branch_true: ...to here
libvirt-12.2.0/src/conf/virstorageobj.c:1384:12: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/conf/virstorageobj.c:1387:25: branch_false: ...to here
libvirt-12.2.0/src/conf/virstorageobj.c:1387:25: call_function: calling ‘virStoragePoolSourceFindDuplicateDevices’ from ‘virStoragePoolObjSourceMatchTypeDEVICE’
libvirt-12.2.0/src/conf/virstorageobj.c:1387:25: return_function: returning to ‘virStoragePoolObjSourceMatchTypeDEVICE’ from ‘virStoragePoolSourceFindDuplicateDevices’
libvirt-12.2.0/src/conf/virstorageobj.c:1387:12: danger: pointer ‘obj’ is checked for NULL here but it was already dereferenced at [(2)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/1)
# 1385| return NULL;
# 1386|
# 1387|-> if ((matchobj = virStoragePoolSourceFindDuplicateDevices(obj, def))) {
# 1388| if (!virStoragePoolSourceISCSIMatch(matchobj, def))
# 1389| return NULL;
Error: GCC_ANALYZER_WARNING (CWE-465):
libvirt-12.2.0/src/conf/virstorageobj.c:1426:13: warning[-Wanalyzer-deref-before-check]: check of ‘payload’ for NULL after already dereferencing it
libvirt-12.2.0/src/conf/virstorageobj.c:1410:1: enter_function: entry to ‘virStoragePoolObjSourceFindDuplicateCb’
libvirt-12.2.0/src/conf/virstorageobj.c:1419:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
libvirt-12.2.0/src/conf/virstorageobj.c:1422:33: branch_false: ...to here
libvirt-12.2.0/src/conf/virstorageobj.c:1426:12: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/conf/virstorageobj.c:1427:13: branch_true: ...to here
libvirt-12.2.0/src/conf/virstorageobj.c:1427:13: call_function: calling ‘virStoragePoolObjSourceMatchTypeDIR’ from ‘virStoragePoolObjSourceFindDuplicateCb’
libvirt-12.2.0/src/conf/virstorageobj.c:1427:13: return_function: returning to ‘virStoragePoolObjSourceFindDuplicateCb’ from ‘virStoragePoolObjSourceMatchTypeDIR’
libvirt-12.2.0/src/conf/virstorageobj.c:1426:13: danger: pointer ‘payload’ is checked for NULL here but it was already dereferenced at [(2)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/1)
# 1424| case VIR_STORAGE_POOL_GLUSTER:
# 1425| case VIR_STORAGE_POOL_NETFS:
# 1426|-> if (data->def->type == obj->def->type &&
# 1427| virStoragePoolObjSourceMatchTypeDIR(obj, data->def))
# 1428| return 1;
Error: GCC_ANALYZER_WARNING (CWE-465):
libvirt-12.2.0/src/conf/virstorageobj.c:1432:13: warning[-Wanalyzer-deref-before-check]: check of ‘payload’ for NULL after already dereferencing it
libvirt-12.2.0/src/conf/virstorageobj.c:1410:1: enter_function: entry to ‘virStoragePoolObjSourceFindDuplicateCb’
libvirt-12.2.0/src/conf/virstorageobj.c:1419:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
libvirt-12.2.0/src/conf/virstorageobj.c:1422:33: branch_false: ...to here
libvirt-12.2.0/src/conf/virstorageobj.c:1432:12: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/conf/virstorageobj.c:1433:13: branch_true: ...to here
libvirt-12.2.0/src/conf/virstorageobj.c:1433:13: call_function: calling ‘virStoragePoolObjSourceMatchTypeISCSI’ from ‘virStoragePoolObjSourceFindDuplicateCb’
libvirt-12.2.0/src/conf/virstorageobj.c:1433:13: return_function: returning to ‘virStoragePoolObjSourceFindDuplicateCb’ from ‘virStoragePoolObjSourceMatchTypeISCSI’
libvirt-12.2.0/src/conf/virstorageobj.c:1432:13: danger: pointer ‘payload’ is checked for NULL here but it was already dereferenced at [(2)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/1)
# 1430|
# 1431| case VIR_STORAGE_POOL_SCSI:
# 1432|-> if (data->def->type == obj->def->type &&
# 1433| virStoragePoolObjSourceMatchTypeISCSI(obj, data->def))
# 1434| return 1;
Error: GCC_ANALYZER_WARNING (CWE-465):
libvirt-12.2.0/src/conf/virstorageobj.c:1442:13: warning[-Wanalyzer-deref-before-check]: check of ‘payload’ for NULL after already dereferencing it
libvirt-12.2.0/src/conf/virstorageobj.c:1410:1: enter_function: entry to ‘virStoragePoolObjSourceFindDuplicateCb’
libvirt-12.2.0/src/conf/virstorageobj.c:1419:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
libvirt-12.2.0/src/conf/virstorageobj.c:1422:33: branch_false: ...to here
libvirt-12.2.0/src/conf/virstorageobj.c:1447:13: call_function: calling ‘virStoragePoolObjSourceMatchTypeDEVICE’ from ‘virStoragePoolObjSourceFindDuplicateCb’
libvirt-12.2.0/src/conf/virstorageobj.c:1447:13: return_function: returning to ‘virStoragePoolObjSourceFindDuplicateCb’ from ‘virStoragePoolObjSourceMatchTypeDEVICE’
libvirt-12.2.0/src/conf/virstorageobj.c:1442:13: danger: pointer ‘payload’ is checked for NULL here but it was already dereferenced at [(2)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/1)
# 1440| case VIR_STORAGE_POOL_DISK:
# 1441| case VIR_STORAGE_POOL_ZFS:
# 1442|-> if ((data->def->type == VIR_STORAGE_POOL_ISCSI ||
# 1443| data->def->type == VIR_STORAGE_POOL_FS ||
# 1444| data->def->type == VIR_STORAGE_POOL_LOGICAL ||
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/esx/esx_util.c:219:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘saveptr’
libvirt-12.2.0/src/esx/esx_util.c:199:1: enter_function: entry to ‘esxUtil_ParseDatastorePath’
libvirt-12.2.0/src/esx/esx_util.c:205:11: release_memory: ‘saveptr’ is NULL
libvirt-12.2.0/src/esx/esx_util.c:219:17: danger: dereference of NULL ‘<unknown>’
# 217|
# 218| /* Expected format: '[<datastore>] <path>' where <path> is optional */
# 219|-> if (!(tmp = STRSKIP(copyOfDatastorePath, "[")) || *tmp == ']' ||
# 220| !(preliminaryDatastoreName = strtok_r(tmp, "]", &saveptr))) {
# 221| virReportError(VIR_ERR_INVALID_ARG,
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/esx/esx_util.c:399:12: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘tmp’
libvirt-12.2.0/src/esx/esx_util.c:414:1: enter_function: entry to ‘esxUtil_EscapeDatastoreItem’
libvirt-12.2.0/src/esx/esx_util.c:421:5: call_function: calling ‘esxUtil_ReplaceSpecialWindowsPathChars’ from ‘esxUtil_EscapeDatastoreItem’
# 397| size_t length;
# 398|
# 399|-> while (*tmp != '\0') {
# 400| length = strspn(tmp, specials);
# 401|
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/hyperv/hyperv_driver.c:835:45: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘driveSettings’
libvirt-12.2.0/src/hyperv/hyperv_driver.c:2962:1: enter_function: entry to ‘hypervDomainDefineXMLFlags’
libvirt-12.2.0/src/hyperv/hyperv_driver.c:2977:5: branch_false: following ‘false’ branch (when ‘__unsuppflags == 0’)...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:2979:8: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:2984:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:2988:19: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3008:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3011:25: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3013:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3017:9: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3030:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3035:9: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3035:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3039:45: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3039:14: call_function: calling ‘hypervDomainLookupByName’ from ‘hypervDomainDefineXMLFlags’
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3039:14: return_function: returning to ‘hypervDomainDefineXMLFlags’ from ‘hypervDomainLookupByName’
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3042:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3046:9: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3046:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3050:9: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3050:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3054:9: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3054:9: call_function: calling ‘hypervDomainAttachStorage’ from ‘hypervDomainDefineXMLFlags’
# 833| return -1;
# 834|
# 835|-> vhdInstanceIdEscaped = virStringReplace(driveSettings->data->InstanceID, "\\", "\\\\");
# 836| vfd__PATH = g_strdup_printf("\\\\%s\\Root\\Virtualization\\V2:"
# 837| "Msvm_ResourceAllocationSettingData.InstanceID=\"%s\"",
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/hyperv/hyperv_driver.c:900:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘domain’
libvirt-12.2.0/src/hyperv/hyperv_driver.c:2962:1: enter_function: entry to ‘hypervDomainDefineXMLFlags’
libvirt-12.2.0/src/hyperv/hyperv_driver.c:2977:5: branch_false: following ‘false’ branch (when ‘__unsuppflags == 0’)...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:2979:8: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:2984:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:2988:19: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3008:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3011:25: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3013:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3017:9: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3030:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3035:9: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3035:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3039:45: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3039:14: call_function: calling ‘hypervDomainLookupByName’ from ‘hypervDomainDefineXMLFlags’
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3039:14: return_function: returning to ‘hypervDomainDefineXMLFlags’ from ‘hypervDomainLookupByName’
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3042:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3046:9: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3046:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3050:9: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3050:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3054:9: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3054:9: call_function: calling ‘hypervDomainAttachStorage’ from ‘hypervDomainDefineXMLFlags’
# 898| hypervDomainAttachStorage(virDomainPtr domain, virDomainDef *def, const char *hostname)
# 899| {
# 900|-> hypervPrivate *priv = domain->conn->privateData;
# 901| size_t i = 0;
# 902| char uuid_string[VIR_UUID_STRING_BUFLEN];
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/hyperv/hyperv_driver.c:2263:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘domain’
libvirt-12.2.0/src/hyperv/hyperv_driver.c:2962:1: enter_function: entry to ‘hypervDomainDefineXMLFlags’
libvirt-12.2.0/src/hyperv/hyperv_driver.c:2977:5: branch_false: following ‘false’ branch (when ‘__unsuppflags == 0’)...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:2979:8: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:2984:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:2988:19: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3008:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3011:25: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3013:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3017:9: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3030:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3035:9: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3035:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3039:45: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3039:14: call_function: calling ‘hypervDomainLookupByName’ from ‘hypervDomainDefineXMLFlags’
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3039:14: return_function: returning to ‘hypervDomainDefineXMLFlags’ from ‘hypervDomainLookupByName’
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3042:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3046:9: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3046:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3046:36: call_function: inlined call to ‘hypervDomainSetMaxMemory’ from ‘hypervDomainDefineXMLFlags’
# 2261| {
# 2262| char uuid_string[VIR_UUID_STRING_BUFLEN];
# 2263|-> hypervPrivate *priv = domain->conn->privateData;
# 2264| g_autoptr(Msvm_VirtualSystemSettingData) vssd = NULL;
# 2265| g_autoptr(Msvm_MemorySettingData) memsd = NULL;
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/hyperv/hyperv_driver.c:2521:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘domain’
libvirt-12.2.0/src/hyperv/hyperv_driver.c:2962:1: enter_function: entry to ‘hypervDomainDefineXMLFlags’
libvirt-12.2.0/src/hyperv/hyperv_driver.c:2977:5: branch_false: following ‘false’ branch (when ‘__unsuppflags == 0’)...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:2979:8: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:2984:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:2988:19: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3008:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3011:25: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3013:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3017:9: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3030:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3035:9: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3035:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3039:45: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3039:14: call_function: calling ‘hypervDomainLookupByName’ from ‘hypervDomainDefineXMLFlags’
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3039:14: return_function: returning to ‘hypervDomainDefineXMLFlags’ from ‘hypervDomainLookupByName’
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3042:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3042:52: branch_true: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:3042:23: call_function: inlined call to ‘hypervDomainSetVcpus’ from ‘hypervDomainDefineXMLFlags’
# 2519| {
# 2520| char uuid_string[VIR_UUID_STRING_BUFLEN];
# 2521|-> hypervPrivate *priv = domain->conn->privateData;
# 2522| g_autoptr(Msvm_VirtualSystemSettingData) vssd = NULL;
# 2523| g_autoptr(Msvm_ProcessorSettingData) proc_sd = NULL;
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/hyperv/hyperv_driver.c:4228:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘snapshotsRet’
libvirt-12.2.0/src/hyperv/hyperv_driver.c:4180:5: branch_false: following ‘false’ branch (when ‘__unsuppflags == 0’)...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:4185:9: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:4185:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:4188:19: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:4190:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:4194:10: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:4203:8: branch_false: following ‘false’ branch (when ‘snaps’ is non-NULL)...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:4206:8: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:4206:8: branch_false: following ‘false’ branch (when ‘count <= 0’)...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:4221:5: branch_false: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:4221:5: release_memory: ‘snapshotsRet’ is NULL
libvirt-12.2.0/src/hyperv/hyperv_driver.c:4225:8: branch_true: following ‘true’ branch (when ‘ret < 0’)...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:4225:8: branch_true: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:4227:21: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/hyperv/hyperv_driver.c:4228:29: branch_true: ...to here
libvirt-12.2.0/src/hyperv/hyperv_driver.c:4228:17: danger: dereference of NULL ‘snapshotsRet + i * 8’
# 4226| size_t i;
# 4227| for (i = 0; i < count; i++) {
# 4228|-> if (snapshotsRet[i])
# 4229| virObjectUnref(snapshotsRet[i]);
# 4230| }
Error: GCC_ANALYZER_WARNING (CWE-465):
libvirt-12.2.0/src/hyperv/hyperv_wmi.c:1008:12: warning[-Wanalyzer-deref-before-check]: check of ‘object’ for NULL after already dereferencing it
# 1006| serializerContext = wsmc_get_serialization_context(((hypervObject *)object)->priv->client);
# 1007|
# 1008|-> while (object != NULL) {
# 1009| next = ((hypervObject *)object)->next;
# 1010|
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/libxl/libxl_driver.c:6291:46: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘iface’
libvirt-12.2.0/src/libxl/libxl_driver.c:6250:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/libxl/libxl_driver.c:6250:8: branch_false: ...to here
libvirt-12.2.0/src/libxl/libxl_driver.c:6253:17: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/libxl/libxl_driver.c:6256:33: branch_true: ...to here
libvirt-12.2.0/src/libxl/libxl_driver.c:6268:12: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/libxl/libxl_driver.c:6271:25: branch_false: ...to here
libvirt-12.2.0/src/libxl/libxl_driver.c:6271:12: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/libxl/libxl_driver.c:6275:12: branch_false: ...to here
libvirt-12.2.0/src/libxl/libxl_driver.c:6275:12: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/libxl/libxl_driver.c:6289:9: branch_false: ...to here
libvirt-12.2.0/src/libxl/libxl_driver.c:6289:21: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/libxl/libxl_driver.c:6290:50: branch_true: ...to here
libvirt-12.2.0/src/libxl/libxl_driver.c:6291:46: danger: dereference of NULL ‘iface’
# 6289| for (j = 0; j < n_leases; j++) {
# 6290| virNetworkDHCPLeasePtr lease = leases[j];
# 6291|-> virDomainIPAddressPtr ip_addr = &iface->addrs[j];
# 6292|
# 6293| ip_addr->addr = g_strdup(lease->ipaddr);
Error: GCC_ANALYZER_WARNING (CWE-775):
libvirt-12.2.0/src/libxl/libxl_logger.c:198:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(g_strdup_printf("%s/%s.log", *logger.logDir, name), "a")’
libvirt-12.2.0/src/libxl/libxl_logger.c:181:1: enter_function: entry to ‘libxlLoggerOpenFile’
libvirt-12.2.0/src/libxl/libxl_logger.c:193:21: acquire_resource: opened here
libvirt-12.2.0/src/libxl/libxl_logger.c:193:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/libxl/libxl_logger.c:198:5: branch_false: ...to here
libvirt-12.2.0/src/libxl/libxl_logger.c:198:5: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/libxl/libxl_logger.c:198:5: call_function: inlined call to ‘glib_auto_cleanup_virLockGuard’ from ‘libxlLoggerOpenFile’
libvirt-12.2.0/src/libxl/libxl_logger.c:198:5: danger: ‘fopen(g_strdup_printf("%s/%s.log", *logger.logDir, name), "a")’ leaks here; was opened at [(2)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/1)
# 196| return;
# 197| }
# 198|-> VIR_WITH_MUTEX_LOCK_GUARD(&logger->tableLock) {
# 199| ignore_value(virHashAddEntry(logger->files, domidstr, logFile));
# 200| }
Error: GCC_ANALYZER_WARNING (CWE-401):
libvirt-12.2.0/src/libxl/libxl_logger.c:198:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(g_strdup_printf("%s/%s.log", *logger.logDir, name), "a")’
libvirt-12.2.0/src/libxl/libxl_logger.c:181:1: enter_function: entry to ‘libxlLoggerOpenFile’
libvirt-12.2.0/src/libxl/libxl_logger.c:193:21: acquire_memory: allocated here
libvirt-12.2.0/src/libxl/libxl_logger.c:193:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/libxl/libxl_logger.c:198:5: branch_false: ...to here
libvirt-12.2.0/src/libxl/libxl_logger.c:198:5: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/libxl/libxl_logger.c:198:5: call_function: inlined call to ‘glib_auto_cleanup_virLockGuard’ from ‘libxlLoggerOpenFile’
libvirt-12.2.0/src/libxl/libxl_logger.c:198:5: danger: ‘fopen(g_strdup_printf("%s/%s.log", *logger.logDir, name), "a")’ leaks here; was allocated at [(2)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/1)
# 196| return;
# 197| }
# 198|-> VIR_WITH_MUTEX_LOCK_GUARD(&logger->tableLock) {
# 199| ignore_value(virHashAddEntry(logger->files, domidstr, logFile));
# 200| }
Error: GCC_ANALYZER_WARNING (CWE-688):
libvirt-12.2.0/src/libxl/xen_xl.c:997:17: warning[-Wanalyzer-null-argument]: use of NULL ‘type’ where non-null expected
libvirt-12.2.0/src/libxl/xen_xl.c:955:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/libxl/xen_xl.c:957:16: branch_true: following ‘true’ branch (when ‘list’ is non-NULL)...
libvirt-12.2.0/src/libxl/xen_xl.c:963:18: branch_true: ...to here
libvirt-12.2.0/src/libxl/xen_xl.c:967:20: branch_true: following ‘true’ branch (when ‘key’ is non-NULL)...
libvirt-12.2.0/src/libxl/xen_xl.c:969:33: branch_true: ...to here
libvirt-12.2.0/src/libxl/xen_xl.c:975:20: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/libxl/xen_xl.c:979:27: branch_false: ...to here
libvirt-12.2.0/src/libxl/xen_xl.c:979:27: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/libxl/xen_xl.c:980:25: branch_false: following ‘false’ branch (when ‘nextkey’ is NULL)...
libvirt-12.2.0/src/libxl/xen_xl.c:980:60: branch_false: ...to here
libvirt-12.2.0/src/libxl/xen_xl.c:987:24: branch_false: following ‘false’ branch (when ‘nextkey’ is NULL)...
libvirt-12.2.0/src/libxl/xen_xl.c:987:24: branch_false: ...to here
libvirt-12.2.0/src/libxl/xen_xl.c:967:20: branch_false: following ‘false’ branch (when ‘key’ is NULL)...
libvirt-12.2.0/src/libxl/xen_xl.c:994:29: branch_false: ...to here
libvirt-12.2.0/src/libxl/xen_xl.c:994:16: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/libxl/xen_xl.c:997:17: branch_false: ...to here
libvirt-12.2.0/src/libxl/xen_xl.c:997:17: danger: argument 1 (‘type’) NULL where non-null expected
# 995| goto cleanup;
# 996|
# 997|-> if (STRPREFIX(type, "socket")) {
# 998| channel->source->type = VIR_DOMAIN_CHR_TYPE_UNIX;
# 999| channel->source->data.nix.listen = 1;
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/lxc/lxc_container.c:1906:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
libvirt-12.2.0/src/lxc/lxc_container.c:1895:12: enter_function: entry to ‘lxcContainerSetHostname’
libvirt-12.2.0/src/lxc/lxc_container.c:1906:9: danger: dereference of NULL ‘<unknown>’
# 1904| virStringFilterChars(name, hostname_validchars);
# 1905| hostname = name;
# 1906|-> if (strlen(name) > 0 && name[0] == '-')
# 1907| hostname = name + 1;
# 1908|
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/lxc/lxc_driver.c:2978:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dev’
libvirt-12.2.0/src/lxc/lxc_driver.c:4389:12: enter_function: entry to ‘lxcDomainAttachDeviceFlags’
libvirt-12.2.0/src/lxc/lxc_driver.c:4401:5: branch_false: following ‘false’ branch (when ‘__unsuppflags == 0’)...
libvirt-12.2.0/src/lxc/lxc_driver.c:4404:16: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4404:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4407:9: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4407:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4410:9: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4410:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4413:9: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4413:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4416:9: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4416:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4423:9: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4423:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4424:26: branch_true: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4424:12: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4430:9: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4430:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4432:17: branch_true: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4433:12: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4436:13: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4436:12: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4441:20: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4441:20: call_function: calling ‘lxcDomainAttachDeviceConfig’ from ‘lxcDomainAttachDeviceFlags’
# 2976| virDomainHostdevDef *hostdev;
# 2977|
# 2978|-> switch (dev->type) {
# 2979| case VIR_DOMAIN_DEVICE_DISK:
# 2980| disk = dev->data.disk;
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/lxc/lxc_driver.c:3122:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dev’
libvirt-12.2.0/src/lxc/lxc_driver.c:4549:12: enter_function: entry to ‘lxcDomainDetachDeviceFlags’
libvirt-12.2.0/src/lxc/lxc_driver.c:4564:5: branch_false: following ‘false’ branch (when ‘__unsuppflags == 0’)...
libvirt-12.2.0/src/lxc/lxc_driver.c:4567:16: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4567:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4570:9: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4570:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4573:9: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4573:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4576:9: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4576:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4579:18: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4579:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4582:9: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4582:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4588:9: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4588:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4589:26: branch_true: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4589:12: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4594:9: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4594:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4596:17: branch_true: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4597:12: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4600:20: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4600:20: call_function: calling ‘lxcDomainDetachDeviceConfig’ from ‘lxcDomainDetachDeviceFlags’
# 3120| int idx;
# 3121|
# 3122|-> switch (dev->type) {
# 3123| case VIR_DOMAIN_DEVICE_DISK:
# 3124| disk = dev->data.disk;
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/lxc/lxc_driver.c:3915:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dev’
libvirt-12.2.0/src/lxc/lxc_driver.c:4389:12: enter_function: entry to ‘lxcDomainAttachDeviceFlags’
libvirt-12.2.0/src/lxc/lxc_driver.c:4401:5: branch_false: following ‘false’ branch (when ‘__unsuppflags == 0’)...
libvirt-12.2.0/src/lxc/lxc_driver.c:4404:16: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4404:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4407:9: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4407:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4410:9: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4410:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4413:9: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4413:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4416:9: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4416:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4417:28: branch_true: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4417:12: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4423:9: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4423:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4430:9: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4430:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4432:17: branch_true: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4433:12: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4436:13: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4436:12: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4441:20: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4441:12: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4445:9: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4445:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4446:44: branch_true: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4446:12: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4451:20: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4451:20: call_function: calling ‘lxcDomainAttachDeviceLive’ from ‘lxcDomainAttachDeviceFlags’
# 3913| int ret = -1;
# 3914|
# 3915|-> switch (dev->type) {
# 3916| case VIR_DOMAIN_DEVICE_DISK:
# 3917| ret = lxcDomainAttachDeviceDiskLive(driver, vm, dev);
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/lxc/lxc_driver.c:4340:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dev’
libvirt-12.2.0/src/lxc/lxc_driver.c:4549:12: enter_function: entry to ‘lxcDomainDetachDeviceFlags’
libvirt-12.2.0/src/lxc/lxc_driver.c:4564:5: branch_false: following ‘false’ branch (when ‘__unsuppflags == 0’)...
libvirt-12.2.0/src/lxc/lxc_driver.c:4567:16: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4567:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4570:9: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4570:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4573:9: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4573:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4576:9: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4576:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4579:18: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4579:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4582:9: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4582:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4583:28: branch_true: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4583:12: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4588:9: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4588:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4594:9: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4594:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4596:17: branch_true: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4597:12: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4600:20: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4600:12: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4604:9: branch_false: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4604:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/lxc/lxc_driver.c:4605:20: branch_true: ...to here
libvirt-12.2.0/src/lxc/lxc_driver.c:4605:20: call_function: calling ‘lxcDomainDetachDeviceLive’ from ‘lxcDomainDetachDeviceFlags’
# 4338| int ret = -1;
# 4339|
# 4340|-> switch (dev->type) {
# 4341| case VIR_DOMAIN_DEVICE_DISK:
# 4342| ret = lxcDomainDetachDeviceDiskLive(vm, dev);
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/node_device/node_device_driver.c:1919:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘defs’
libvirt-12.2.0/src/node_device/node_device_driver.c:1891:1: enter_function: entry to ‘nodeDeviceUpdateMediatedDevices’
libvirt-12.2.0/src/node_device/node_device_driver.c:1893:35: release_memory: ‘defs’ is NULL
libvirt-12.2.0/src/node_device/node_device_driver.c:1894:35: release_memory: ‘defs’ is NULL
libvirt-12.2.0/src/node_device/node_device_driver.c:1901:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/node_device/node_device_driver.c:1906:23: branch_false: ...to here
libvirt-12.2.0/src/node_device/node_device_driver.c:1906:23: call_function: calling ‘virMdevctlList’ from ‘nodeDeviceUpdateMediatedDevices’
libvirt-12.2.0/src/node_device/node_device_driver.c:1906:23: return_function: returning to ‘nodeDeviceUpdateMediatedDevices’ from ‘virMdevctlList’
libvirt-12.2.0/src/node_device/node_device_driver.c:1906:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/node_device/node_device_driver.c:1914:5: branch_false: ...to here
libvirt-12.2.0/src/node_device/node_device_driver.c:1914:5: release_memory: ‘defs’ is NULL
libvirt-12.2.0/src/node_device/node_device_driver.c:1918:17: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/node_device/node_device_driver.c:1919:48: branch_true: ...to here
libvirt-12.2.0/src/node_device/node_device_driver.c:1919:48: release_memory: ‘defs’ is NULL
libvirt-12.2.0/src/node_device/node_device_driver.c:1919:13: danger: dereference of NULL ‘defs + i * 8’
# 1917|
# 1918| for (i = 0; i < data.ndefs; i++)
# 1919|-> if (nodeDeviceUpdateMediatedDevice(defs[i], true) < 0)
# 1920| return -1;
# 1921|
Error: GCC_ANALYZER_WARNING (CWE-688):
libvirt-12.2.0/src/qemu/qemu_alias.c:43:10: warning[-Wanalyzer-null-argument]: use of NULL ‘prefix’ where non-null expected
libvirt-12.2.0/src/qemu/qemu_alias.c:84:1: enter_function: entry to ‘qemuAssignDeviceChrAlias’
libvirt-12.2.0/src/qemu/qemu_alias.c:127:8: branch_true: following ‘true’ branch (when ‘idx == -1’)...
libvirt-12.2.0/src/qemu/qemu_alias.c:127:29: branch_true: ...to here
libvirt-12.2.0/src/qemu/qemu_alias.c:127:29: call_function: calling ‘qemuGetNextChrDevIndex’ from ‘qemuAssignDeviceChrAlias’
# 41| if (!info->alias)
# 42| return -1;
# 43|-> if (!STRPREFIX(info->alias, prefix))
# 44| return -1;
# 45|
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/qemu/qemu_blockjob.c:1087:5: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘baseparent’
libvirt-12.2.0/src/qemu/qemu_blockjob.c:1650:1: enter_function: entry to ‘qemuBlockJobUpdate’
libvirt-12.2.0/src/qemu/qemu_blockjob.c:1656:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/qemu/qemu_blockjob.c:1659:5: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_blockjob.c:1659:5: call_function: calling ‘qemuBlockJobEventProcess’ from ‘qemuBlockJobUpdate’
# 1085|
# 1086|
# 1087|-> baseparent->backingStore = NULL;
# 1088| job->data.commit.topparent->backingStore = job->data.commit.base;
# 1089|
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/qemu/qemu_blockjob.c:1177:5: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘baseparent’
libvirt-12.2.0/src/qemu/qemu_blockjob.c:1650:1: enter_function: entry to ‘qemuBlockJobUpdate’
libvirt-12.2.0/src/qemu/qemu_blockjob.c:1656:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/qemu/qemu_blockjob.c:1659:5: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_blockjob.c:1659:5: call_function: calling ‘qemuBlockJobEventProcess’ from ‘qemuBlockJobUpdate’
# 1175| VIR_WARN("Unable to move disk metadata on vm %s", vm->def->name);
# 1176|
# 1177|-> baseparent->backingStore = NULL;
# 1178| job->disk->src = job->data.commit.base;
# 1179| job->disk->src->readonly = job->data.commit.top->readonly;
Error: GCC_ANALYZER_WARNING (CWE-688):
libvirt-12.2.0/src/qemu/qemu_capabilities.c:6118:9: warning[-Wanalyzer-null-argument]: use of NULL ‘binary’ where non-null expected
libvirt-12.2.0/src/qemu/qemu_capabilities.c:6177:1: enter_function: entry to ‘virQEMUCapsNewData’
libvirt-12.2.0/src/qemu/qemu_capabilities.c:6182:12: call_function: calling ‘virQEMUCapsNewForBinaryInternal’ from ‘virQEMUCapsNewData’
# 6116| /* We would also want to check faccessat if we cared about ACLs,
# 6117| * but we don't. */
# 6118|-> if (stat(binary, &sb) < 0) {
# 6119| virReportSystemError(errno, _("Cannot check QEMU binary %1$s"),
# 6120| binary);
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/qemu/qemu_driver.c:4456:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘vcpuinfo’
libvirt-12.2.0/src/qemu/qemu_driver.c:4417:5: branch_false: following ‘false’ branch (when ‘__unsuppflags == 0’)...
libvirt-12.2.0/src/qemu/qemu_driver.c:4420:11: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_driver.c:4422:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/qemu/qemu_driver.c:4425:9: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_driver.c:4425:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/qemu/qemu_driver.c:4428:9: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_driver.c:4428:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/qemu/qemu_driver.c:4431:9: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_driver.c:4431:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/qemu/qemu_driver.c:4434:9: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_driver.c:4434:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/qemu/qemu_driver.c:4442:21: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_driver.c:4442:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/qemu/qemu_driver.c:4445:9: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_driver.c:4445:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/qemu/qemu_driver.c:4451:9: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_driver.c:4455:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/qemu/qemu_driver.c:4456:9: branch_true: ...to here
libvirt-12.2.0/src/qemu/qemu_driver.c:4456:9: danger: dereference of NULL ‘vcpuinfo’
# 4454|
# 4455| if (persistentDef) {
# 4456|-> virBitmapFree(vcpuinfo->cpumask);
# 4457| vcpuinfo->cpumask = g_steal_pointer(&pcpumap);
# 4458|
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/qemu/qemu_driver.c:7197:43: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dev’
libvirt-12.2.0/src/qemu/qemu_driver.c:7487:1: enter_function: entry to ‘qemuDomainUpdateDeviceFlags’
libvirt-12.2.0/src/qemu/qemu_driver.c:7503:5: branch_false: following ‘false’ branch (when ‘__unsuppflags == 0’)...
libvirt-12.2.0/src/qemu/qemu_driver.c:7507:11: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_driver.c:7509:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/qemu/qemu_driver.c:7512:5: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_driver.c:7514:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/qemu/qemu_driver.c:7517:9: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_driver.c:7517:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/qemu/qemu_driver.c:7520:9: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_driver.c:7520:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/qemu/qemu_driver.c:7523:9: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_driver.c:7527:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/qemu/qemu_driver.c:7533:9: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_driver.c:7533:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/qemu/qemu_driver.c:7535:50: branch_true: ...to here
libvirt-12.2.0/src/qemu/qemu_driver.c:7534:12: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/qemu/qemu_driver.c:7539:9: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_driver.c:7539:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/qemu/qemu_driver.c:7542:47: branch_true: ...to here
libvirt-12.2.0/src/qemu/qemu_driver.c:7543:12: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/qemu/qemu_driver.c:7548:20: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_driver.c:7548:20: call_function: calling ‘qemuDomainUpdateDeviceConfig’ from ‘qemuDomainUpdateDeviceFlags’
# 7195| virDomainNetDef *net;
# 7196| virDomainMemoryDef *mem;
# 7197|-> virDomainDeviceDef oldDev = { .type = dev->type };
# 7198| int pos;
# 7199|
Error: GCC_ANALYZER_WARNING (CWE-688):
libvirt-12.2.0/src/qemu/qemu_namespace.c:1217:9: warning[-Wanalyzer-null-argument]: use of NULL ‘file’ where non-null expected
libvirt-12.2.0/src/qemu/qemu_namespace.c:1746:1: enter_function: entry to ‘qemuDomainNamespaceSetupInput’
libvirt-12.2.0/src/qemu/qemu_namespace.c:1753:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/qemu/qemu_namespace.c:1756:9: branch_true: ...to here
libvirt-12.2.0/src/qemu/qemu_namespace.c:1756:9: call_function: calling ‘qemuDomainSetupInput’ from ‘qemuDomainNamespaceSetupInput’
libvirt-12.2.0/src/qemu/qemu_namespace.c:1756:9: return_function: returning to ‘qemuDomainNamespaceSetupInput’ from ‘qemuDomainSetupInput’
libvirt-12.2.0/src/qemu/qemu_namespace.c:1759:16: call_function: calling ‘qemuNamespaceMknodPaths’ from ‘qemuDomainNamespaceSetupInput’
# 1215| item->file = g_strdup(file);
# 1216|
# 1217|-> if (g_lstat(file, &item->sb) < 0) {
# 1218| if (errno == ENOENT)
# 1219| return -2;
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/qemu/qemu_namespace.c:1475:41: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘mount’
libvirt-12.2.0/src/qemu/qemu_namespace.c:1767:1: enter_function: entry to ‘qemuDomainNamespaceTeardownInput’
libvirt-12.2.0/src/qemu/qemu_namespace.c:1772:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/qemu/qemu_namespace.c:1775:9: branch_true: ...to here
libvirt-12.2.0/src/qemu/qemu_namespace.c:1775:9: call_function: calling ‘qemuDomainSetupInput’ from ‘qemuDomainNamespaceTeardownInput’
libvirt-12.2.0/src/qemu/qemu_namespace.c:1775:9: return_function: returning to ‘qemuDomainNamespaceTeardownInput’ from ‘qemuDomainSetupInput’
libvirt-12.2.0/src/qemu/qemu_namespace.c:1778:9: call_function: calling ‘qemuNamespaceUnlinkPaths’ from ‘qemuDomainNamespaceTeardownInput’
# 1473| const char *const *devices = (const char *const *)cfg->cgroupDeviceACL;
# 1474|
# 1475|-> for (mount = devMountsPath; *mount; mount++) {
# 1476| if (STREQ(*mount, "/dev"))
# 1477| continue;
Error: GCC_ANALYZER_WARNING (CWE-688):
libvirt-12.2.0/src/qemu/qemu_nbdkit.c:252:9: warning[-Wanalyzer-null-argument]: use of NULL ‘*caps.path’ where non-null expected
libvirt-12.2.0/src/qemu/qemu_nbdkit.c:354:1: enter_function: entry to ‘virNbdkitCapsNewData’
libvirt-12.2.0/src/qemu/qemu_nbdkit.c:365:12: call_function: calling ‘qemuNbdkitCapsNew’ from ‘virNbdkitCapsNewData’
libvirt-12.2.0/src/qemu/qemu_nbdkit.c:365:12: return_function: returning to ‘virNbdkitCapsNewData’ from ‘qemuNbdkitCapsNew’
libvirt-12.2.0/src/qemu/qemu_nbdkit.c:366:5: call_function: calling ‘qemuNbdkitCapsQuery’ from ‘virNbdkitCapsNewData’
# 250| struct stat st;
# 251|
# 252|-> if (stat(caps->path, &st) < 0) {
# 253| VIR_DEBUG("Failed to stat nbdkit binary '%s': %s",
# 254| caps->path,
Error: GCC_ANALYZER_WARNING (CWE-688):
libvirt-12.2.0/src/qemu/qemu_nbdkit.c:1264:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘nbd_create()’ where non-null expected
libvirt-12.2.0/src/qemu/qemu_nbdkit.c:1175:1: enter_function: entry to ‘qemuNbdkitProcessStart’
libvirt-12.2.0/src/qemu/qemu_nbdkit.c:1195:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/qemu/qemu_nbdkit.c:1201:17: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_nbdkit.c:1201:17: call_function: calling ‘qemuNbdkitProcessBuildCommand’ from ‘qemuNbdkitProcessStart’
libvirt-12.2.0/src/qemu/qemu_nbdkit.c:1201:17: return_function: returning to ‘qemuNbdkitProcessStart’ from ‘qemuNbdkitProcessBuildCommand’
libvirt-12.2.0/src/qemu/qemu_nbdkit.c:1201:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/qemu/qemu_nbdkit.c:1204:24: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_nbdkit.c:1204:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/qemu/qemu_nbdkit.c:1212:13: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_nbdkit.c:1219:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/qemu/qemu_nbdkit.c:1222:9: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_nbdkit.c:1234:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/qemu/qemu_nbdkit.c:1237:9: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_nbdkit.c:1237:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/qemu/qemu_nbdkit.c:1243:15: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_nbdkit.c:1243:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/qemu/qemu_nbdkit.c:1250:9: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_nbdkit.c:1250:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/qemu/qemu_nbdkit.c:1250:8: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_nbdkit.c:1253:12: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/qemu/qemu_nbdkit.c:1254:27: branch_true: ...to here
libvirt-12.2.0/src/qemu/qemu_nbdkit.c:1263:19: acquire_memory: this call could return NULL
libvirt-12.2.0/src/qemu/qemu_nbdkit.c:1264:17: danger: argument 1 (‘nbd_create()’) from [(25)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/24) could be NULL where non-null expected
# 1262| */
# 1263| nbd = nbd_create();
# 1264|-> if (nbd_connect_unix(nbd, proc->socketfile) < 0) {
# 1265| VIR_WARN("nbd_connect_unix failed: %s", nbd_get_error());
# 1266| nbd_close(nbd);
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/qemu/qemu_snapshot.c:2547:16: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘tmpsnapdef’
libvirt-12.2.0/src/qemu/qemu_snapshot.c:2940:1: enter_function: entry to ‘qemuSnapshotRevert’
libvirt-12.2.0/src/qemu/qemu_snapshot.c:2953:5: branch_false: following ‘false’ branch (when ‘__unsuppflags == 0’)...
libvirt-12.2.0/src/qemu/qemu_snapshot.c:2958:9: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_snapshot.c:2974:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/qemu/qemu_snapshot.c:2980:9: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_snapshot.c:2980:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/qemu/qemu_snapshot.c:2986:18: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_snapshot.c:2986:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/qemu/qemu_snapshot.c:2988:15: call_function: inlined call to ‘virDomainSnapshotObjGetDef’ from ‘qemuSnapshotRevert’
libvirt-12.2.0/src/qemu/qemu_snapshot.c:2990:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/qemu/qemu_snapshot.c:2993:9: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_snapshot.c:2993:9: call_function: calling ‘qemuSnapshotRevertPrep’ from ‘qemuSnapshotRevert’
libvirt-12.2.0/src/qemu/qemu_snapshot.c:2993:9: return_function: returning to ‘qemuSnapshotRevert’ from ‘qemuSnapshotRevertPrep’
libvirt-12.2.0/src/qemu/qemu_snapshot.c:2993:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/qemu/qemu_snapshot.c:2998:38: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_snapshot.c:3001:15: call_function: calling ‘qemuSnapshotRevertActive’ from ‘qemuSnapshotRevert’
# 2545| g_autoptr(qemuSnapshotDiskContext) snapctxt = NULL;
# 2546|
# 2547|-> snapctxt = qemuSnapshotDiskContextNew(tmpsnapdef->ndisks, vm, VIR_ASYNC_JOB_SNAPSHOT);
# 2548|
# 2549| if (!(blockNamedNodeData = qemuBlockGetNamedNodeData(vm, VIR_ASYNC_JOB_SNAPSHOT)))
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/qemu/qemu_vhost_user.c:330:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘vu’
libvirt-12.2.0/src/qemu/qemu_vhost_user.c:340:1: enter_function: entry to ‘qemuVhostUserFillDomainGPU’
libvirt-12.2.0/src/qemu/qemu_vhost_user.c:349:17: call_function: calling ‘qemuVhostUserFetchParsedConfigs’ from ‘qemuVhostUserFillDomainGPU’
libvirt-12.2.0/src/qemu/qemu_vhost_user.c:349:17: return_function: returning to ‘qemuVhostUserFillDomainGPU’ from ‘qemuVhostUserFetchParsedConfigs’
libvirt-12.2.0/src/qemu/qemu_vhost_user.c:349:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/qemu/qemu_vhost_user.c:349:8: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_vhost_user.c:353:17: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/qemu/qemu_vhost_user.c:398:8: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_vhost_user.c:398:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/qemu/qemu_vhost_user.c:404:10: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_vhost_user.c:404:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/qemu/qemu_vhost_user.c:407:10: branch_false: ...to here
libvirt-12.2.0/src/qemu/qemu_vhost_user.c:407:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/qemu/qemu_vhost_user.c:407:8: branch_true: ...to here
libvirt-12.2.0/src/qemu/qemu_vhost_user.c:408:9: call_function: inlined call to ‘qemuVhostUserGPUHasFeature’ from ‘qemuVhostUserFillDomainGPU’
# 328| size_t i;
# 329|
# 330|-> for (i = 0; i < gpu->nfeatures; i++) {
# 331| if (gpu->features[i] == feature)
# 332| return true;
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:3392:43: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:3356:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:3359:5: branch_false: ...to here
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:3361:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:3365:8: branch_false: ...to here
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:3365:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:3369:8: branch_false: ...to here
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:3369:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:3371:15: branch_false: ...to here
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:3373:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:3379:9: branch_false: ...to here
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:3379:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:3385:5: branch_false: ...to here
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:3388:17: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:3390:43: branch_true: ...to here
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:3392:43: danger: dereference of NULL ‘params + i * 88’
# 3390| ret->params.params_val[i].field = g_strdup(params[i].field);
# 3391|
# 3392|-> ret->params.params_val[i].value = params[i].value;
# 3393| }
# 3394|
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:3458:43: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:3422:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:3425:5: branch_false: ...to here
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:3427:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:3431:8: branch_false: ...to here
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:3431:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:3435:8: branch_false: ...to here
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:3435:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:3437:15: branch_false: ...to here
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:3439:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:3445:9: branch_false: ...to here
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:3445:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:3451:5: branch_false: ...to here
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:3454:17: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:3456:43: branch_true: ...to here
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:3458:43: danger: dereference of NULL ‘params + i * 88’
# 3456| ret->params.params_val[i].field = g_strdup(params[i].field);
# 3457|
# 3458|-> ret->params.params_val[i].value = params[i].value;
# 3459| }
# 3460|
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:5276:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:5235:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:5238:9: branch_false: ...to here
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:5238:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:5242:9: branch_false: ...to here
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:5242:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:5247:8: branch_false: ...to here
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:5247:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:5247:8: branch_false: ...to here
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:5250:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:5255:39: branch_false: ...to here
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:5256:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:5259:9: branch_false: ...to here
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:5272:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:5275:21: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:5276:23: branch_true: ...to here
libvirt-12.2.0/src/remote/remote_daemon_dispatch.c:5276:17: danger: dereference of NULL ‘params + i * 96’
# 5274|
# 5275| for (i = 0; i < percpu_len; i++) {
# 5276|-> if (params[i].type == VIR_TYPED_PARAM_STRING)
# 5277| ret->nparams--;
# 5278| }
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/remote/remote_driver.c:3531:10: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘state’
libvirt-12.2.0/src/remote/remote_driver.c:3596:12: enter_function: entry to ‘remoteAuthInteract’
libvirt-12.2.0/src/remote/remote_driver.c:3601:5: call_function: inlined call to ‘remoteAuthInteractStateClear’ from ‘remoteAuthInteract’
libvirt-12.2.0/src/remote/remote_driver.c:3604:9: branch_true: ...to here
libvirt-12.2.0/src/remote/remote_driver.c:3604:9: call_function: calling ‘remoteAuthFillFromConfig’ from ‘remoteAuthInteract’
# 3529| VIR_DEBUG("Trying to fill auth parameters from config file");
# 3530|
# 3531|-> if (!state->config) {
# 3532| if (virAuthGetConfigFilePath(conn, &path) < 0)
# 3533| return -1;
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/remote/remote_driver.c:6907:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘leases_ret’
libvirt-12.2.0/src/remote/remote_driver.c:6872:1: enter_function: entry to ‘remoteNetworkGetDHCPLeases’
libvirt-12.2.0/src/remote/remote_driver.c:6886:16: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/remote/remote_driver.c:6886:5: branch_true: ...to here
libvirt-12.2.0/src/remote/remote_driver.c:6890:9: call_function: calling ‘call’ from ‘remoteNetworkGetDHCPLeases’
libvirt-12.2.0/src/remote/remote_driver.c:6890:9: return_function: returning to ‘remoteNetworkGetDHCPLeases’ from ‘call’
libvirt-12.2.0/src/remote/remote_driver.c:6890:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/remote/remote_driver.c:6895:9: branch_false: ...to here
libvirt-12.2.0/src/remote/remote_driver.c:6895:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/remote/remote_driver.c:6902:8: branch_false: ...to here
libvirt-12.2.0/src/remote/remote_driver.c:6902:8: branch_true: following ‘true’ branch (when ‘leases’ is non-NULL)...
libvirt-12.2.0/src/remote/remote_driver.c:6903:12: branch_true: ...to here
libvirt-12.2.0/src/remote/remote_driver.c:6903:12: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/remote/remote_driver.c:6906:9: branch_false: ...to here
libvirt-12.2.0/src/remote/remote_driver.c:6906:21: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/remote/remote_driver.c:6907:29: branch_true: ...to here
libvirt-12.2.0/src/remote/remote_driver.c:6907:13: danger: dereference of NULL ‘leases_ret + i * 8’
# 6905|
# 6906| for (i = 0; i < ret.leases.leases_len; i++) {
# 6907|-> leases_ret[i] = g_new0(virNetworkDHCPLease, 1);
# 6908|
# 6909| if (remoteSerializeDHCPLease(leases_ret[i], &ret.leases.leases_val[i]) < 0)
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/remote/remote_driver.c:7150:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ifaces_ret’
libvirt-12.2.0/src/remote/remote_driver.c:7111:1: enter_function: entry to ‘remoteDomainInterfaceAddresses’
libvirt-12.2.0/src/remote/remote_driver.c:7129:9: call_function: calling ‘call’ from ‘remoteDomainInterfaceAddresses’
libvirt-12.2.0/src/remote/remote_driver.c:7129:9: return_function: returning to ‘remoteDomainInterfaceAddresses’ from ‘call’
libvirt-12.2.0/src/remote/remote_driver.c:7129:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/remote/remote_driver.c:7136:9: branch_false: ...to here
libvirt-12.2.0/src/remote/remote_driver.c:7136:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/remote/remote_driver.c:7143:8: branch_false: ...to here
libvirt-12.2.0/src/remote/remote_driver.c:7143:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/remote/remote_driver.c:7146:5: branch_false: ...to here
libvirt-12.2.0/src/remote/remote_driver.c:7146:17: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/remote/remote_driver.c:7148:48: branch_true: ...to here
libvirt-12.2.0/src/remote/remote_driver.c:7150:9: danger: dereference of NULL ‘ifaces_ret + i * 8’
# 7148| remote_domain_interface *iface_ret = &(ret.ifaces.ifaces_val[i]);
# 7149|
# 7150|-> ifaces_ret[i] = g_new0(virDomainInterface, 1);
# 7151|
# 7152| iface = ifaces_ret[i];
Error: GCC_ANALYZER_WARNING (CWE-126):
libvirt-12.2.0/src/rpc/virnetserverservice.c:145:25: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
libvirt-12.2.0/src/rpc/virnetserverservice.c:228:22: enter_function: entry to ‘virNetServerServiceNewUNIX’
libvirt-12.2.0/src/rpc/virnetserverservice.c:242:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/rpc/virnetserverservice.c:249:11: branch_false: ...to here
libvirt-12.2.0/src/rpc/virnetserverservice.c:249:11: call_function: calling ‘virNetServerServiceNewSocket’ from ‘virNetServerServiceNewUNIX’
# 143| svc->nsocks = nsocks;
# 144| for (i = 0; i < svc->nsocks; i++) {
# 145|-> svc->socks[i] = socks[i];
# 146| virObjectRef(svc->socks[i]);
# 147| }
Error: GCC_ANALYZER_WARNING (CWE-688):
libvirt-12.2.0/src/rpc/virnetsocket.c:754:9: warning[-Wanalyzer-null-argument]: use of NULL ‘lockpath’ where non-null expected
libvirt-12.2.0/src/rpc/virnetsocket.c:659:5: enter_function: entry to ‘virNetSocketNewConnectUNIX’
libvirt-12.2.0/src/rpc/virnetsocket.c:677:8: branch_false: following ‘false’ branch (when ‘spawnDaemonPath’ is NULL)...
libvirt-12.2.0/src/rpc/virnetsocket.c:702:15: branch_false: ...to here
libvirt-12.2.0/src/rpc/virnetsocket.c:702:8: branch_false: following ‘false’ branch (when ‘fd >= 0’)...
libvirt-12.2.0/src/rpc/virnetsocket.c:707:5: branch_false: ...to here
libvirt-12.2.0/src/rpc/virnetsocket.c:708:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/rpc/virnetsocket.c:712:9: branch_false: ...to here
libvirt-12.2.0/src/rpc/virnetsocket.c:747:22: call_function: calling ‘virNetSocketNew’ from ‘virNetSocketNewConnectUNIX’
libvirt-12.2.0/src/rpc/virnetsocket.c:747:22: return_function: returning to ‘virNetSocketNewConnectUNIX’ from ‘virNetSocketNew’
libvirt-12.2.0/src/rpc/virnetsocket.c:747:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/rpc/virnetsocket.c:752:2: branch_false: ...to here
libvirt-12.2.0/src/rpc/virnetsocket.c:753:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/rpc/virnetsocket.c:754:9: branch_true: ...to here
libvirt-12.2.0/src/rpc/virnetsocket.c:754:9: danger: argument 1 (‘lockpath’) NULL where non-null expected
# 752| cleanup:
# 753| if (lockfd != -1) {
# 754|-> unlink(lockpath);
# 755| }
# 756|
Error: GCC_ANALYZER_WARNING (CWE-775):
libvirt-12.2.0/src/rpc/virnetsocket.c:2035:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*sock.fd’
# 2033| {
# 2034| virObjectLock(sock);
# 2035|-> if (listen(sock->fd, backlog > 0 ? backlog : 30) < 0) {
# 2036| virReportSystemError(errno, "%s", _("Unable to listen on socket"));
# 2037| virObjectUnlock(sock);
Error: GCC_ANALYZER_WARNING (CWE-775):
libvirt-12.2.0/src/rpc/virnetsocket.c:2040:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*sock.fd’
libvirt-12.2.0/src/rpc/virnetsocket.c:2035:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/rpc/virnetsocket.c:2040:5: branch_false: ...to here
libvirt-12.2.0/src/rpc/virnetsocket.c:2040:5: danger: ‘*sock.fd’ leaks here
# 2038| return -1;
# 2039| }
# 2040|-> virObjectUnlock(sock);
# 2041| return 0;
# 2042| }
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/rpc/virnettlscontext.c:132:37: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘keys’
libvirt-12.2.0/src/rpc/virnettlscontext.c:381:19: enter_function: entry to ‘virNetTLSContextNewClient’
libvirt-12.2.0/src/rpc/virnettlscontext.c:390:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/rpc/virnettlscontext.c:390:8: branch_false: ...to here
libvirt-12.2.0/src/rpc/virnettlscontext.c:396:12: call_function: calling ‘virNetTLSContextNew’ from ‘virNetTLSContextNewClient’
# 130| }
# 131|
# 132|-> for (i = 0; certs[i] != NULL && keys[i] != NULL; i++) {
# 133| VIR_DEBUG("loading cert and key from %s and %s", certs[i], keys[i]);
# 134| err = gnutls_certificate_set_x509_key_file(ctxt->x509cred,
Error: GCC_ANALYZER_WARNING (CWE-688):
libvirt-12.2.0/src/storage/storage_backend_logical.c:431:13: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-12.2.0/src/storage/storage_backend_logical.c:416:1: enter_function: entry to ‘virStorageBackendLogicalFindPoolSourcesFunc’
libvirt-12.2.0/src/storage/storage_backend_logical.c:430:17: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/storage/storage_backend_logical.c:431:13: branch_true: ...to here
libvirt-12.2.0/src/storage/storage_backend_logical.c:431:13: danger: argument 2 (‘<unknown>’) NULL where non-null expected
# 429| thisSource = NULL;
# 430| for (i = 0; i < sourceList->nsources; i++) {
# 431|-> if (STREQ(sourceList->sources[i].name, vgname)) {
# 432| thisSource = &sourceList->sources[i];
# 433| break;
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/storage/storage_backend_logical.c:587:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘thisSource’
libvirt-12.2.0/src/storage/storage_backend_logical.c:557:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/storage/storage_backend_logical.c:557:8: branch_false: ...to here
libvirt-12.2.0/src/storage/storage_backend_logical.c:561:17: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/storage/storage_backend_logical.c:567:8: branch_false: ...to here
libvirt-12.2.0/src/storage/storage_backend_logical.c:567:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/storage/storage_backend_logical.c:578:9: branch_false: ...to here
libvirt-12.2.0/src/storage/storage_backend_logical.c:578:7: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/storage/storage_backend_logical.c:578:7: branch_false: ...to here
libvirt-12.2.0/src/storage/storage_backend_logical.c:586:17: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/storage/storage_backend_logical.c:586:17: branch_true: ...to here
libvirt-12.2.0/src/storage/storage_backend_logical.c:587:25: danger: dereference of NULL ‘thisSource’
# 585| */
# 586| for (i = 0; i < def->source.ndevice; i++) {
# 587|-> for (j = 0; j < thisSource->ndevice; j++) {
# 588| if (STREQ(def->source.devices[i].path,
# 589| thisSource->devices[j].path))
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/test/test_driver.c:10578:43: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dev’
libvirt-12.2.0/src/test/test_driver.c:10643:1: enter_function: entry to ‘testDomainUpdateDeviceFlags’
libvirt-12.2.0/src/test/test_driver.c:10658:5: branch_false: following ‘false’ branch (when ‘__unsuppflags == 0’)...
libvirt-12.2.0/src/test/test_driver.c:10661:16: branch_false: ...to here
libvirt-12.2.0/src/test/test_driver.c:10661:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/test/test_driver.c:10664:9: branch_false: ...to here
libvirt-12.2.0/src/test/test_driver.c:10664:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/test/test_driver.c:10667:9: branch_false: ...to here
libvirt-12.2.0/src/test/test_driver.c:10667:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/test/test_driver.c:10670:9: branch_false: ...to here
libvirt-12.2.0/src/test/test_driver.c:10675:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/test/test_driver.c:10678:9: branch_false: ...to here
libvirt-12.2.0/src/test/test_driver.c:10678:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/test/test_driver.c:10684:9: branch_false: ...to here
libvirt-12.2.0/src/test/test_driver.c:10684:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/test/test_driver.c:10691:9: branch_false: ...to here
libvirt-12.2.0/src/test/test_driver.c:10691:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/test/test_driver.c:10693:17: branch_true: ...to here
libvirt-12.2.0/src/test/test_driver.c:10694:12: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/test/test_driver.c:10699:20: branch_false: ...to here
libvirt-12.2.0/src/test/test_driver.c:10699:20: call_function: calling ‘testDomainUpdateDevice’ from ‘testDomainUpdateDeviceFlags’
#10576| {
#10577| virDomainDiskDef *newDisk;
#10578|-> virDomainDeviceDef oldDev = { .type = dev->type };
#10579| int pos;
#10580|
Error: GCC_ANALYZER_WARNING (CWE-688):
libvirt-12.2.0/src/util/vircgroupv1.c:368:26: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-12.2.0/src/util/vircgroupv1.c:332:1: enter_function: entry to ‘virCgroupV1DetectPlacement’
libvirt-12.2.0/src/util/vircgroupv1.c:339:17: branch_true: following ‘true’ branch (when ‘i != 10’)...
libvirt-12.2.0/src/util/vircgroupv1.c:340:31: branch_true: ...to here
libvirt-12.2.0/src/util/vircgroupv1.c:344:14: call_function: calling ‘virCgroupV1MountOptsMatchController’ from ‘virCgroupV1DetectPlacement’
libvirt-12.2.0/src/util/vircgroupv1.c:344:14: return_function: returning to ‘virCgroupV1DetectPlacement’ from ‘virCgroupV1MountOptsMatchController’
libvirt-12.2.0/src/util/vircgroupv1.c:368:26: danger: argument 1 (‘<unknown>’) NULL where non-null expected
# 366| group->legacy[i].placement = g_strdup(placement);
# 367| } else {
# 368|-> bool delim = STREQ(placement, "/") || STREQ(path, "");
# 369|
# 370| group->legacy[i].placement = g_strdup_printf("%s%s%s", placement,
Error: GCC_ANALYZER_WARNING (CWE-775):
libvirt-12.2.0/src/util/virdaemon.c:66:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(stdinfd, 0)’
libvirt-12.2.0/src/util/virdaemon.c:43:1: enter_function: entry to ‘virDaemonForkIntoBackground’
libvirt-12.2.0/src/util/virdaemon.c:48:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/util/virdaemon.c:51:11: branch_false: ...to here
libvirt-12.2.0/src/util/virdaemon.c:62:16: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/util/virdaemon.c:64:29: call_function: inlined call to ‘open’ from ‘virDaemonForkIntoBackground’
libvirt-12.2.0/src/util/virdaemon.c:64:16: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/util/virdaemon.c:66:17: branch_false: ...to here
libvirt-12.2.0/src/util/virdaemon.c:66:17: acquire_resource: opened here
libvirt-12.2.0/src/util/virdaemon.c:66:16: danger: ‘dup2(stdinfd, 0)’ leaks here; was opened at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
# 64| if ((stdoutfd = open("/dev/null", O_WRONLY)) < 0)
# 65| goto cleanup;
# 66|-> if (dup2(stdinfd, STDIN_FILENO) != STDIN_FILENO)
# 67| goto cleanup;
# 68| if (dup2(stdoutfd, STDOUT_FILENO) != STDOUT_FILENO)
Error: GCC_ANALYZER_WARNING (CWE-775):
libvirt-12.2.0/src/util/virdaemon.c:68:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(stdoutfd, 1)’
libvirt-12.2.0/src/util/virdaemon.c:43:1: enter_function: entry to ‘virDaemonForkIntoBackground’
libvirt-12.2.0/src/util/virdaemon.c:48:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/util/virdaemon.c:51:11: branch_false: ...to here
libvirt-12.2.0/src/util/virdaemon.c:62:16: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/util/virdaemon.c:64:29: call_function: inlined call to ‘open’ from ‘virDaemonForkIntoBackground’
libvirt-12.2.0/src/util/virdaemon.c:64:16: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/util/virdaemon.c:66:17: branch_false: ...to here
libvirt-12.2.0/src/util/virdaemon.c:66:16: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/util/virdaemon.c:68:17: branch_false: ...to here
libvirt-12.2.0/src/util/virdaemon.c:68:17: acquire_resource: opened here
libvirt-12.2.0/src/util/virdaemon.c:68:16: danger: ‘dup2(stdoutfd, 1)’ leaks here; was opened at [(13)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/12)
# 66| if (dup2(stdinfd, STDIN_FILENO) != STDIN_FILENO)
# 67| goto cleanup;
# 68|-> if (dup2(stdoutfd, STDOUT_FILENO) != STDOUT_FILENO)
# 69| goto cleanup;
# 70| if (dup2(stdoutfd, STDERR_FILENO) != STDERR_FILENO)
Error: GCC_ANALYZER_WARNING (CWE-775):
libvirt-12.2.0/src/util/virdaemon.c:70:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(stdoutfd, 2)’
libvirt-12.2.0/src/util/virdaemon.c:43:1: enter_function: entry to ‘virDaemonForkIntoBackground’
libvirt-12.2.0/src/util/virdaemon.c:48:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/util/virdaemon.c:51:11: branch_false: ...to here
libvirt-12.2.0/src/util/virdaemon.c:62:16: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/util/virdaemon.c:64:29: call_function: inlined call to ‘open’ from ‘virDaemonForkIntoBackground’
libvirt-12.2.0/src/util/virdaemon.c:64:16: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/util/virdaemon.c:66:17: branch_false: ...to here
libvirt-12.2.0/src/util/virdaemon.c:66:16: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/util/virdaemon.c:68:17: branch_false: ...to here
libvirt-12.2.0/src/util/virdaemon.c:68:16: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/util/virdaemon.c:70:17: branch_false: ...to here
libvirt-12.2.0/src/util/virdaemon.c:70:17: acquire_resource: opened here
libvirt-12.2.0/src/util/virdaemon.c:70:16: danger: ‘dup2(stdoutfd, 2)’ leaks here; was opened at [(15)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/14)
# 68| if (dup2(stdoutfd, STDOUT_FILENO) != STDOUT_FILENO)
# 69| goto cleanup;
# 70|-> if (dup2(stdoutfd, STDERR_FILENO) != STDERR_FILENO)
# 71| goto cleanup;
# 72| if (VIR_CLOSE(stdinfd) < 0)
Error: GCC_ANALYZER_WARNING (CWE-688):
libvirt-12.2.0/src/util/virfdstream.c:1363:9: warning[-Wanalyzer-null-argument]: use of NULL ‘path’ where non-null expected
libvirt-12.2.0/src/util/virfdstream.c:1263:1: enter_function: entry to ‘virFDStreamOpenFileInternal’
libvirt-12.2.0/src/util/virfdstream.c:1284:14: call_function: inlined call to ‘open’ from ‘virFDStreamOpenFileInternal’
libvirt-12.2.0/src/util/virfdstream.c:1287:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/util/virfdstream.c:1295:9: branch_false: ...to here
libvirt-12.2.0/src/util/virfdstream.c:1295:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/util/virfdstream.c:1302:8: branch_false: ...to here
libvirt-12.2.0/src/util/virfdstream.c:1315:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/util/virfdstream.c:1316:12: branch_true: ...to here
libvirt-12.2.0/src/util/virfdstream.c:1319:12: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/util/virfdstream.c:1326:13: branch_false: ...to here
libvirt-12.2.0/src/util/virfdstream.c:1326:12: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/util/virfdstream.c:1329:22: branch_false: ...to here
libvirt-12.2.0/src/util/virfdstream.c:1347:13: release_memory: ‘path’ is NULL
libvirt-12.2.0/src/util/virfdstream.c:1353:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/util/virfdstream.c:1354:9: branch_true: ...to here
libvirt-12.2.0/src/util/virfdstream.c:1362:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/util/virfdstream.c:1363:9: branch_true: ...to here
libvirt-12.2.0/src/util/virfdstream.c:1363:9: danger: argument 1 (‘path’) NULL where non-null expected
# 1361| VIR_FORCE_CLOSE(pipefds[1]);
# 1362| if (oflags & O_CREAT)
# 1363|-> unlink(path);
# 1364| virFDStreamThreadDataFree(threadData);
# 1365| return -1;
Error: GCC_ANALYZER_WARNING (CWE-688):
libvirt-12.2.0/src/util/virfile.c:2138:13: warning[-Wanalyzer-null-argument]: use of NULL ‘path’ where non-null expected
libvirt-12.2.0/src/util/virfile.c:2809:1: enter_function: entry to ‘virFileRemove’
libvirt-12.2.0/src/util/virfile.c:2818:10: call_function: calling ‘virFileRemoveNeedsSetuid’ from ‘virFileRemove’
libvirt-12.2.0/src/util/virfile.c:2818:10: return_function: returning to ‘virFileRemove’ from ‘virFileRemoveNeedsSetuid’
libvirt-12.2.0/src/util/virfile.c:2818:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/util/virfile.c:2829:8: branch_true: ...to here
libvirt-12.2.0/src/util/virfile.c:2838:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/util/virfile.c:2841:8: branch_false: ...to here
libvirt-12.2.0/src/util/virfile.c:2841:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/util/virfile.c:2867:9: branch_false: ...to here
libvirt-12.2.0/src/util/virfile.c:2867:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/util/virfile.c:2872:9: branch_false: ...to here
libvirt-12.2.0/src/util/virfile.c:2872:9: call_function: calling ‘virFileIsDir’ from ‘virFileRemove’
# 2136| {
# 2137| struct stat s;
# 2138|-> return (stat(path, &s) == 0) && S_ISDIR(s.st_mode);
# 2139| }
# 2140|
Error: GCC_ANALYZER_WARNING (CWE-688):
libvirt-12.2.0/src/util/virfile.c:3760:12: warning[-Wanalyzer-null-argument]: use of NULL ‘path’ where non-null expected
libvirt-12.2.0/src/util/virfile.c:3765:1: enter_function: entry to ‘virFileIsSharedFSType’
libvirt-12.2.0/src/util/virfile.c:3768:22: release_memory: ‘dirpath’ is NULL
libvirt-12.2.0/src/util/virfile.c:3774:15: call_function: calling ‘virFileCheckParents’ from ‘virFileIsSharedFSType’
# 3758| void *opaque)
# 3759| {
# 3760|-> return statfs(path, (struct statfs *) opaque) == 0;
# 3761| }
# 3762|
Error: GCC_ANALYZER_WARNING (CWE-688):
libvirt-12.2.0/src/util/virfile.c:3810:9: warning[-Wanalyzer-null-argument]: use of NULL ‘path’ where non-null expected
libvirt-12.2.0/src/util/virfile.c:3868:1: enter_function: entry to ‘virFileFindHugeTLBFS’
libvirt-12.2.0/src/util/virfile.c:3879:8: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
libvirt-12.2.0/src/util/virfile.c:3879:8: branch_false: ...to here
libvirt-12.2.0/src/util/virfile.c:3886:12: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/util/virfile.c:3889:13: branch_true: ...to here
libvirt-12.2.0/src/util/virfile.c:3896:9: release_memory: using NULL here
libvirt-12.2.0/src/util/virfile.c:3898:13: call_function: calling ‘virFileGetHugepageSize’ from ‘virFileFindHugeTLBFS’
# 3808| struct statfs fs;
# 3809|
# 3810|-> if (statfs(path, &fs) < 0) {
# 3811| virReportSystemError(errno,
# 3812| _("cannot determine filesystem for '%1$s'"),
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/util/virfirewall.c:1009:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
libvirt-12.2.0/src/util/virfirewall.c:977:1: enter_function: entry to ‘virFirewallNewFromRollback’
libvirt-12.2.0/src/util/virfirewall.c:983:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/util/virfirewall.c:989:16: branch_false: ...to here
libvirt-12.2.0/src/util/virfirewall.c:994:33: branch_true: following ‘true’ branch (when ‘g != 0’)...
libvirt-12.2.0/src/util/virfirewall.c:996:35: branch_true: ...to here
libvirt-12.2.0/src/util/virfirewall.c:1001:9: call_function: calling ‘virFirewallStartTransaction’ from ‘virFirewallNewFromRollback’
libvirt-12.2.0/src/util/virfirewall.c:1001:9: return_function: returning to ‘virFirewallNewFromRollback’ from ‘virFirewallStartTransaction’
libvirt-12.2.0/src/util/virfirewall.c:1003:36: branch_true: following ‘true’ branch (when ‘r != 0’)...
libvirt-12.2.0/src/util/virfirewall.c:1005:39: branch_true: ...to here
libvirt-12.2.0/src/util/virfirewall.c:1006:37: call_function: calling ‘virFirewallAddCmdFull’ from ‘virFirewallNewFromRollback’
libvirt-12.2.0/src/util/virfirewall.c:1006:37: return_function: returning to ‘virFirewallNewFromRollback’ from ‘virFirewallAddCmdFull’
libvirt-12.2.0/src/util/virfirewall.c:1008:25: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/util/virfirewall.c:1009:17: branch_true: ...to here
libvirt-12.2.0/src/util/virfirewall.c:1009:17: danger: dereference of NULL ‘virFirewallAddCmdFull(virFirewallNew(*original.backend), *origCmd.layer, 0, 0, 0, 0)’
# 1007|
# 1008| for (i = 0; i < origCmd->argsLen; i++)
# 1009|-> ADD_ARG(rbCmd, origCmd->args[i]);
# 1010| }
# 1011| }
Error: GCC_ANALYZER_WARNING (CWE-688):
libvirt-12.2.0/src/util/virlockspace.c:94:17: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-12.2.0/src/util/virlockspace.c:111:1: enter_function: entry to ‘virLockSpaceResourceNew’
libvirt-12.2.0/src/util/virlockspace.c:126:23: call_function: calling ‘virLockSpaceGetResourcePath’ from ‘virLockSpaceResourceNew’
libvirt-12.2.0/src/util/virlockspace.c:126:23: return_function: returning to ‘virLockSpaceResourceNew’ from ‘virLockSpaceGetResourcePath’
libvirt-12.2.0/src/util/virlockspace.c:126:10: release_memory: using NULL here
libvirt-12.2.0/src/util/virlockspace.c:126:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/util/virlockspace.c:127:9: branch_true: ...to here
libvirt-12.2.0/src/util/virlockspace.c:220:5: call_function: calling ‘virLockSpaceResourceFree’ from ‘virLockSpaceResourceNew’
# 92| }
# 93| } else {
# 94|-> if (unlink(res->path) < 0 &&
# 95| errno != ENOENT) {
# 96| VIR_WARN("Failed to unlink resource %s: %s",
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/util/virmdev.c:400:48: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dev’
libvirt-12.2.0/src/util/virmdev.c:419:1: enter_function: entry to ‘virMediatedDeviceListMarkDevices’
libvirt-12.2.0/src/util/virmdev.c:429:17: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/util/virmdev.c:430:35: branch_true: ...to here
libvirt-12.2.0/src/util/virmdev.c:430:35: call_function: calling ‘virMediatedDeviceListGet’ from ‘virMediatedDeviceListMarkDevices’
libvirt-12.2.0/src/util/virmdev.c:430:35: return_function: returning to ‘virMediatedDeviceListMarkDevices’ from ‘virMediatedDeviceListGet’
libvirt-12.2.0/src/util/virmdev.c:430:28: release_memory: ‘mdev’ is NULL
libvirt-12.2.0/src/util/virmdev.c:432:13: call_function: calling ‘virMediatedDeviceIsUsed’ from ‘virMediatedDeviceListMarkDevices’
# 398| virMediatedDevice *tmp = NULL;
# 399|
# 400|-> if ((tmp = virMediatedDeviceListFind(list, dev->path))) {
# 401| virMediatedDeviceGetUsedBy(tmp, &drvname, &domname);
# 402| virReportError(VIR_ERR_OPERATION_INVALID,
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/util/virobject.c:226:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘parent’
libvirt-12.2.0/src/util/virobject.c:289:1: enter_function: entry to ‘virObjectRWLockableNew’
libvirt-12.2.0/src/util/virobject.c:293:10: call_function: calling ‘virClassForObjectRWLockable’ from ‘virObjectRWLockableNew’
libvirt-12.2.0/src/util/virobject.c:293:10: return_function: returning to ‘virObjectRWLockableNew’ from ‘virClassForObjectRWLockable’
libvirt-12.2.0/src/util/virobject.c:293:10: call_function: calling ‘virClassIsDerivedFrom’ from ‘virObjectRWLockableNew’
# 224| {
# 225| while (klass) {
# 226|-> if (klass->magic == parent->magic)
# 227| return true;
# 228| klass = klass->parent;
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/src/util/virpcivpd.c:181:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘v’
libvirt-12.2.0/src/util/virpcivpd.c:597:1: enter_function: entry to ‘virPCIVPDParse’
libvirt-12.2.0/src/util/virpcivpd.c:615:12: branch_true: following ‘true’ branch...
libvirt-12.2.0/src/util/virpcivpd.c:617:13: branch_true: ...to here
libvirt-12.2.0/src/util/virpcivpd.c:617:13: call_function: calling ‘virPCIVPDReadVPDBytes’ from ‘virPCIVPDParse’
libvirt-12.2.0/src/util/virpcivpd.c:617:13: return_function: returning to ‘virPCIVPDParse’ from ‘virPCIVPDReadVPDBytes’
libvirt-12.2.0/src/util/virpcivpd.c:617:12: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/util/virpcivpd.c:621:13: branch_false: ...to here
libvirt-12.2.0/src/util/virpcivpd.c:645:12: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/util/virpcivpd.c:655:13: branch_false: ...to here
libvirt-12.2.0/src/util/virpcivpd.c:655:12: branch_false: following ‘false’ branch...
libvirt-12.2.0/src/util/virpcivpd.c:661:9: branch_false: ...to here
libvirt-12.2.0/src/util/virpcivpd.c:664:21: call_function: calling ‘virPCIVPDParseVPDLargeResourceString’ from ‘virPCIVPDParse’
# 179| bool ret = true;
# 180|
# 181|-> for (v = value; *v; v++) {
# 182| if (!g_ascii_isprint(*v)) {
# 183| ret = false;
Error: GCC_ANALYZER_WARNING (CWE-688):
libvirt-12.2.0/src/util/virrotatingfile.c:183:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-12.2.0/src/util/virrotatingfile.c:229:1: enter_function: entry to ‘virRotatingFileWriterNew’
libvirt-12.2.0/src/util/virrotatingfile.c:241:8: branch_false: following ‘false’ branch (when ‘maxbackup <= 32’)...
libvirt-12.2.0/src/util/virrotatingfile.c:248:5: branch_false: ...to here
libvirt-12.2.0/src/util/virrotatingfile.c:252:8: branch_true: following ‘true’ branch (when ‘trunc != 0’)...
libvirt-12.2.0/src/util/virrotatingfile.c:253:9: branch_true: ...to here
libvirt-12.2.0/src/util/virrotatingfile.c:253:9: call_function: calling ‘virRotatingFileWriterDelete’ from ‘virRotatingFileWriterNew’
# 181| size_t i;
# 182|
# 183|-> if (unlink(file->basepath) < 0 &&
# 184| errno != ENOENT) {
# 185| virReportSystemError(errno,
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/tools/virsh-completer-checkpoint.c:69:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
libvirt-12.2.0/tools/virsh-completer-checkpoint.c:39:5: branch_false: following ‘false’ branch (when ‘flags == 0’)...
libvirt-12.2.0/tools/virsh-completer-checkpoint.c:41:10: branch_false: ...to here
libvirt-12.2.0/tools/virsh-completer-checkpoint.c:41:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/tools/virsh-completer-checkpoint.c:44:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/tools/virsh-completer-checkpoint.c:47:25: branch_false: ...to here
libvirt-12.2.0/tools/virsh-completer-checkpoint.c:47:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/tools/virsh-completer-checkpoint.c:49:9: branch_true: ...to here
libvirt-12.2.0/tools/virsh-completer-checkpoint.c:68:17: branch_true: following ‘true’ branch...
libvirt-12.2.0/tools/virsh-completer-checkpoint.c:69:19: branch_true: ...to here
libvirt-12.2.0/tools/virsh-completer-checkpoint.c:69:9: danger: dereference of NULL ‘(char **)(i * 8)’
# 67| g_free(checkpoints);
# 68| for (i = 0; i < ncheckpoints; i++)
# 69|-> g_free(ret[i]);
# 70| g_free(ret);
# 71| return NULL;
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/tools/virsh-domain-monitor.c:1709:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘_pp’
libvirt-12.2.0/tools/virsh-domain-monitor.c:1511:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/tools/virsh-domain-monitor.c:1518:9: branch_false: ...to here
libvirt-12.2.0/tools/virsh-domain-monitor.c:1518:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/tools/virsh-domain-monitor.c:1548:12: branch_false: following ‘false’ branch...
libvirt-12.2.0/tools/virsh-domain-monitor.c:1553:12: branch_false: ...to here
libvirt-12.2.0/tools/virsh-domain-monitor.c:1553:12: branch_true: following ‘true’ branch...
libvirt-12.2.0/tools/virsh-domain-monitor.c:1554:19: branch_true: ...to here
libvirt-12.2.0/tools/virsh-domain-monitor.c:1708:17: branch_true: following ‘true’ branch...
libvirt-12.2.0/tools/virsh-domain-monitor.c:1709:9: danger: dereference of NULL ‘_pp’
# 1707| cleanup:
# 1708| for (i = 0; nnames != -1 && i < nnames; i++)
# 1709|-> VIR_FREE(names[i]);
# 1710|
# 1711| if (!success) {
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/tools/virsh-domain.c:9169:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
libvirt-12.2.0/tools/virsh-domain.c:9161:12: enter_function: entry to ‘getSignalNumber’
libvirt-12.2.0/tools/virsh-domain.c:9168:17: branch_true: following ‘true’ branch...
libvirt-12.2.0/tools/virsh-domain.c:9169:10: branch_true: ...to here
libvirt-12.2.0/tools/virsh-domain.c:9169:10: release_memory: using NULL here
libvirt-12.2.0/tools/virsh-domain.c:9169:9: danger: dereference of NULL ‘<unknown> + i’
# 9167|
# 9168| for (i = 0; signame[i]; i++)
# 9169|-> p[i] = g_ascii_tolower(signame[i]);
# 9170|
# 9171| if (virStrToLong_i(p, NULL, 10, &signum) >= 0)
Error: GCC_ANALYZER_WARNING (CWE-688):
libvirt-12.2.0/tools/virsh-domain.c:9174:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libvirt-12.2.0/tools/virsh-domain.c:9161:12: enter_function: entry to ‘getSignalNumber’
libvirt-12.2.0/tools/virsh-domain.c:9168:17: branch_false: following ‘false’ branch...
libvirt-12.2.0/tools/virsh-domain.c:9171:9: branch_false: ...to here
libvirt-12.2.0/tools/virsh-domain.c:9171:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/tools/virsh-domain.c:9174:9: branch_false: ...to here
libvirt-12.2.0/tools/virsh-domain.c:9174:9: danger: argument 1 (‘<unknown>’) NULL where non-null expected
# 9172| return signum;
# 9173|
# 9174|-> if (STRPREFIX(p, "sig_"))
# 9175| p += 4;
# 9176| else if (STRPREFIX(p, "sig"))
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/tools/virsh-interface.c:295:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘_pp’
libvirt-12.2.0/tools/virsh-interface.c:294:17: branch_true: following ‘true’ branch...
libvirt-12.2.0/tools/virsh-interface.c:295:9: danger: dereference of NULL ‘_pp’
# 293| cleanup:
# 294| for (i = 0; nActiveIfaces != -1 && i < nActiveIfaces; i++)
# 295|-> VIR_FREE(activeNames[i]);
# 296|
# 297| for (i = 0; nInactiveIfaces != -1 && i < nInactiveIfaces; i++)
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/tools/virsh-interface.c:298:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘_pp’
libvirt-12.2.0/tools/virsh-interface.c:194:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/tools/virsh-interface.c:202:9: branch_false: ...to here
libvirt-12.2.0/tools/virsh-interface.c:202:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/tools/virsh-interface.c:214:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/tools/virsh-interface.c:215:25: branch_true: ...to here
libvirt-12.2.0/tools/virsh-interface.c:216:12: branch_false: following ‘false’ branch...
libvirt-12.2.0/tools/virsh-interface.c:220:12: branch_false: ...to here
libvirt-12.2.0/tools/virsh-interface.c:220:12: branch_true: following ‘true’ branch...
libvirt-12.2.0/tools/virsh-interface.c:221:27: branch_true: ...to here
libvirt-12.2.0/tools/virsh-interface.c:297:17: branch_true: following ‘true’ branch...
libvirt-12.2.0/tools/virsh-interface.c:298:9: danger: dereference of NULL ‘_pp’
# 296|
# 297| for (i = 0; nInactiveIfaces != -1 && i < nInactiveIfaces; i++)
# 298|-> VIR_FREE(inactiveNames[i]);
# 299|
# 300| VIR_FREE(activeNames);
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/tools/virsh-nodedev.c:343:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘_pp’
libvirt-12.2.0/tools/virsh-nodedev.c:251:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/tools/virsh-nodedev.c:252:9: branch_true: ...to here
libvirt-12.2.0/tools/virsh-nodedev.c:342:17: branch_true: following ‘true’ branch...
libvirt-12.2.0/tools/virsh-nodedev.c:343:9: danger: dereference of NULL ‘_pp’
# 341| cleanup:
# 342| for (i = 0; ndevices != -1 && i < ndevices; i++)
# 343|-> VIR_FREE(names[i]);
# 344| VIR_FREE(names);
# 345|
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/tools/virsh-nwfilter.c:327:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘_pp’
libvirt-12.2.0/tools/virsh-nwfilter.c:283:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/tools/virsh-nwfilter.c:284:9: branch_true: ...to here
libvirt-12.2.0/tools/virsh-nwfilter.c:326:17: branch_true: following ‘true’ branch...
libvirt-12.2.0/tools/virsh-nwfilter.c:327:9: danger: dereference of NULL ‘_pp’
# 325| cleanup:
# 326| for (i = 0; nfilters != -1 && i < nfilters; i++)
# 327|-> VIR_FREE(names[i]);
# 328| VIR_FREE(names);
# 329|
Error: GCC_ANALYZER_WARNING (CWE-688):
libvirt-12.2.0/tools/virsh-secret.c:240:22: warning[-Wanalyzer-null-argument]: use of NULL ‘secret_val’ where non-null expected
libvirt-12.2.0/tools/virsh-secret.c:210:1: enter_function: entry to ‘cmdSecretSetValue’
libvirt-12.2.0/tools/virsh-secret.c:215:22: release_memory: ‘secret_val’ is NULL
libvirt-12.2.0/tools/virsh-secret.c:227:20: call_function: calling ‘virshCommandOptSecret’ from ‘cmdSecretSetValue’
libvirt-12.2.0/tools/virsh-secret.c:227:20: return_function: returning to ‘cmdSecretSetValue’ from ‘virshCommandOptSecret’
libvirt-12.2.0/tools/virsh-secret.c:227:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/tools/virsh-secret.c:230:9: branch_false: ...to here
libvirt-12.2.0/tools/virsh-secret.c:230:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/tools/virsh-secret.c:233:9: branch_false: ...to here
libvirt-12.2.0/tools/virsh-secret.c:233:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/tools/virsh-secret.c:236:9: branch_false: ...to here
libvirt-12.2.0/tools/virsh-secret.c:236:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/tools/virsh-secret.c:238:9: branch_true: ...to here
libvirt-12.2.0/tools/virsh-secret.c:240:22: danger: argument 1 (‘<unknown>’) NULL where non-null expected
# 238| vshWarn(ctl, "%s", _("Passing secret value as command-line argument is insecure!"));
# 239| secret_val = g_strdup(base64);
# 240|-> secret_len = strlen(secret_val);
# 241| } else if (filename) {
# 242| ssize_t read_ret;
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/tools/virsh-volume.c:1381:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘volInfoTexts’
libvirt-12.2.0/tools/virsh-volume.c:1325:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/tools/virsh-volume.c:1328:18: branch_false: ...to here
libvirt-12.2.0/tools/virsh-volume.c:1328:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/tools/virsh-volume.c:1331:9: branch_false: ...to here
libvirt-12.2.0/tools/virsh-volume.c:1331:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/tools/virsh-volume.c:1335:5: branch_false: ...to here
libvirt-12.2.0/tools/virsh-volume.c:1335:17: branch_false: following ‘false’ branch...
libvirt-12.2.0/tools/virsh-volume.c:1374:8: branch_false: ...to here
libvirt-12.2.0/tools/virsh-volume.c:1374:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/tools/virsh-volume.c:1376:17: branch_false: ...to here
libvirt-12.2.0/tools/virsh-volume.c:1377:12: branch_false: following ‘false’ branch...
libvirt-12.2.0/tools/virsh-volume.c:1377:12: branch_false: ...to here
libvirt-12.2.0/tools/virsh-volume.c:1380:21: branch_true: following ‘true’ branch...
libvirt-12.2.0/tools/virsh-volume.c:1383:47: branch_true: ...to here
libvirt-12.2.0/tools/virsh-volume.c:1381:17: danger: dereference of NULL ‘volInfoTexts + i * 32’
# 1379|
# 1380| for (i = 0; i < list->nvols; i++) {
# 1381|-> if (vshTableRowAppend(table,
# 1382| virStorageVolGetName(list->vols[i]),
# 1383| volInfoTexts[i].path,
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/tools/virsh-volume.c:1404:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘volInfoTexts’
libvirt-12.2.0/tools/virsh-volume.c:1325:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/tools/virsh-volume.c:1328:18: branch_false: ...to here
libvirt-12.2.0/tools/virsh-volume.c:1328:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/tools/virsh-volume.c:1331:9: branch_false: ...to here
libvirt-12.2.0/tools/virsh-volume.c:1331:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/tools/virsh-volume.c:1335:5: branch_false: ...to here
libvirt-12.2.0/tools/virsh-volume.c:1335:17: branch_false: following ‘false’ branch...
libvirt-12.2.0/tools/virsh-volume.c:1374:8: branch_false: ...to here
libvirt-12.2.0/tools/virsh-volume.c:1374:8: branch_true: following ‘true’ branch...
libvirt-12.2.0/tools/virsh-volume.c:1398:13: branch_true: ...to here
libvirt-12.2.0/tools/virsh-volume.c:1399:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/tools/virsh-volume.c:1399:8: branch_false: ...to here
libvirt-12.2.0/tools/virsh-volume.c:1403:17: branch_true: following ‘true’ branch...
libvirt-12.2.0/tools/virsh-volume.c:1409:43: branch_true: ...to here
libvirt-12.2.0/tools/virsh-volume.c:1404:13: danger: dereference of NULL ‘volInfoTexts + i * 32’
# 1402| /* Insert the volume info rows into table */
# 1403| for (i = 0; i < list->nvols; i++) {
# 1404|-> if (vshTableRowAppend(table,
# 1405| virStorageVolGetName(list->vols[i]),
# 1406| volInfoTexts[i].path,
Error: GCC_ANALYZER_WARNING (CWE-476):
libvirt-12.2.0/tools/virsh-volume.c:1425:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘volInfoTexts’
libvirt-12.2.0/tools/virsh-volume.c:1325:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/tools/virsh-volume.c:1328:18: branch_false: ...to here
libvirt-12.2.0/tools/virsh-volume.c:1328:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/tools/virsh-volume.c:1331:9: branch_false: ...to here
libvirt-12.2.0/tools/virsh-volume.c:1331:8: branch_false: following ‘false’ branch...
libvirt-12.2.0/tools/virsh-volume.c:1335:5: branch_false: ...to here
libvirt-12.2.0/tools/virsh-volume.c:1335:17: branch_false: following ‘false’ branch...
libvirt-12.2.0/tools/virsh-volume.c:1374:8: branch_false: ...to here
libvirt-12.2.0/tools/virsh-volume.c:1377:12: branch_true: following ‘true’ branch...
libvirt-12.2.0/tools/virsh-volume.c:1378:13: branch_true: ...to here
libvirt-12.2.0/tools/virsh-volume.c:1422:9: branch_true: following ‘true’ branch...
libvirt-12.2.0/tools/virsh-volume.c:1422:9: branch_true: ...to here
libvirt-12.2.0/tools/virsh-volume.c:1423:21: branch_true: following ‘true’ branch...
libvirt-12.2.0/tools/virsh-volume.c:1425:13: branch_true: ...to here
libvirt-12.2.0/tools/virsh-volume.c:1425:13: danger: dereference of NULL ‘volInfoTexts + i * 32’
# 1423| for (i = 0; i < list->nvols; i++) {
# 1424| /* Cleanup the memory for one volume info structure per loop */
# 1425|-> VIR_FREE(volInfoTexts[i].path);
# 1426| VIR_FREE(volInfoTexts[i].type);
# 1427| VIR_FREE(volInfoTexts[i].capacity);