initscripts-10.27-3.fc45

List of Findings

Error: SHELLCHECK_WARNING (CWE-252): [#def1]
/usr/libexec/import-state:6:1: warning[SC2164]: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
#    4|   # Copy state into root folder:
#    5|   # ============================
#    6|-> cd /run/initramfs/state
#    7|   
#    8|   IFS_backup=$IFS

Error: SHELLCHECK_WARNING (CWE-252): [#def2]
/usr/libexec/import-state:14:3: warning[SC2164]: Use 'pushd ... || exit' or 'pushd ... || return' in case pushd fails.
#   12|   
#   13|   for dir in $dirs_found; do
#   14|->   pushd "$dir" > /dev/null
#   15|   
#   16|     # Remove initial '.' char from the find's result:

Error: SHELLCHECK_WARNING (CWE-252): [#def3]
/usr/libexec/import-state:29:3: warning[SC2164]: Use 'popd ... || exit' or 'popd ... || return' in case popd fails.
#   27|     find . -mindepth 1 -maxdepth 1 -not -type d -exec cp -av -t "$dest_dir" {} \; > /dev/null
#   28|   
#   29|->   popd > /dev/null
#   30|   done
#   31|   

Error: SHELLCHECK_WARNING (CWE-156): [#def4]
/usr/libexec/netconsole:99:7: warning[SC2046]: Quote this to prevent word splitting.
#   97|   		exit 6
#   98|   	fi
#   99|-> 	eval $(print_address_info $SYSLOGADDR)
#  100|   
#  101|   	if [ -z "$SYSLOGMACADDR" ]; then

Error: SHELLCHECK_WARNING (CWE-153): [#def5]
/usr/libexec/readonly-root:119:33: warning[SC2053]: Quote the right-hand side of = in [[ ]] to prevent glob matching.
#  117|                   prefix=0
#  118|                   for mount_point in "${MOUNTS[@]}"; do
#  119|->                         [[ $m = $mount_point ]] && continue
#  120|                           if [[ $m =~ ^$mount_point/.* ]] ; then
#  121|                                   prefix=1

Error: SHELLCHECK_WARNING (CWE-477): [#def6]
/usr/libexec/readonly-root:139:33: warning[SC2166]: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
#  137|   	# must be done even if we have local storage.
#  138|   	ipaddr=
#  139|-> 	if [ "$HOSTNAME" = "localhost" -o "$HOSTNAME" = "localhost.localdomain" ]; then
#  140|   		ipaddr=$(ip addr show to 0.0.0.0/0 scope global | awk '/[[:space:]]inet / { print gensub("/.*","","g",$2) }')
#  141|   		for ip in $ipaddr ; do

Error: SHELLCHECK_WARNING (CWE-563): [#def7]
/usr/libexec/readonly-root:141:3: warning[SC2034]: ip appears unused. Verify use (or export if used externally).
#  139|   	if [ "$HOSTNAME" = "localhost" -o "$HOSTNAME" = "localhost.localdomain" ]; then
#  140|   		ipaddr=$(ip addr show to 0.0.0.0/0 scope global | awk '/[[:space:]]inet / { print gensub("/.*","","g",$2) }')
#  141|-> 		for ip in $ipaddr ; do
#  142|   			HOSTNAME=
#  143|   			eval $(ipcalc -h $ipaddr 2>/dev/null)

Error: SHELLCHECK_WARNING (CWE-156): [#def8]
/usr/libexec/readonly-root:143:9: warning[SC2046]: Quote this to prevent word splitting.
#  141|   		for ip in $ipaddr ; do
#  142|   			HOSTNAME=
#  143|-> 			eval $(ipcalc -h $ipaddr 2>/dev/null)
#  144|   			[ -n "$HOSTNAME" ] && { hostname ${HOSTNAME} ; break; }
#  145|   		done

Error: GCC_ANALYZER_WARNING (CWE-775): [#def9]
initscripts-10.27/src/genhostid.c:45:19: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/random", 0)’
initscripts-10.27/src/genhostid.c:43:12: acquire_resource: opened here
initscripts-10.27/src/genhostid.c:45:6: branch_false: following ‘false’ branch...
initscripts-10.27/src/genhostid.c:45:19: branch_false: ...to here
initscripts-10.27/src/genhostid.c:45:19: danger: ‘open("/dev/random", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   43|     int fd = open ("/dev/random", O_RDONLY);
#   44|   
#   45|->   if (fd == -1 || read (fd, &n, sizeof (n)) != sizeof (n)) {
#   46|       srand48 ((long int) time (NULL) ^ (long int) getpid ());
#   47|       n = lrand48 ();

Error: CPPCHECK_WARNING (CWE-476): [#def10]
initscripts-10.27/src/rename_device.c:228: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tmpdev
#  226|   		}
#  227|   		tmpdev = calloc(1, sizeof(struct netdev));
#  228|-> 		tmpdev->dev = g_strstrip(g_strdup(devname));
#  229|   		tmpdev->hwaddr = g_strstrip(g_strdup(hwaddr));
#  230|   		if (ret)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def11]
initscripts-10.27/src/rename_device.c:228:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tmpdev’
initscripts-10.27/src/rename_device.c:363:5: enter_function: entry to ‘main’
initscripts-10.27/src/rename_device.c:379:12: branch_false: following ‘false’ branch (when ‘src’ is non-NULL)...
initscripts-10.27/src/rename_device.c:382:19: branch_false: ...to here
initscripts-10.27/src/rename_device.c:382:19: call_function: calling ‘get_configs’ from ‘main’
#  226|   		}
#  227|   		tmpdev = calloc(1, sizeof(struct netdev));
#  228|-> 		tmpdev->dev = g_strstrip(g_strdup(devname));
#  229|   		tmpdev->hwaddr = g_strstrip(g_strdup(hwaddr));
#  230|   		if (ret)

Error: CPPCHECK_WARNING (CWE-476): [#def12]
initscripts-10.27/src/rename_device.c:229: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tmpdev
#  227|   		tmpdev = calloc(1, sizeof(struct netdev));
#  228|   		tmpdev->dev = g_strstrip(g_strdup(devname));
#  229|-> 		tmpdev->hwaddr = g_strstrip(g_strdup(hwaddr));
#  230|   		if (ret)
#  231|   			tmpdev->next = ret;

Error: CPPCHECK_WARNING (CWE-476): [#def13]
initscripts-10.27/src/rename_device.c:231: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tmpdev
#  229|   		tmpdev->hwaddr = g_strstrip(g_strdup(hwaddr));
#  230|   		if (ret)
#  231|-> 			tmpdev->next = ret;
#  232|   		ret = tmpdev;
#  233|   		g_free(contents);

Scan Properties

analyzer-version-clippy1.97.1
analyzer-version-cppcheck2.21.1
analyzer-version-gcc16.1.1
analyzer-version-gcc-analyzer16.1.1
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-242.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20260524.213755.g3c6d0be.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-nameinitscripts-10.27-3.fc45
store-results-to/tmp/tmpc76kcgqy/initscripts-10.27-3.fc45.tar.xz
time-created2026-08-03 15:24:37
time-finished2026-08-03 15:25:41
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,unicontrol,shellcheck,cppcheck' '-o' '/tmp/tmpc76kcgqy/initscripts-10.27-3.fc45.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpc76kcgqy/initscripts-10.27-3.fc45.src.rpm'
tool-versioncsmock-3.8.7.20260803.142340.gb75b18e-1.el9