Newly introduced findings

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1]
shadow-4.18.0/src/newgrp.c:297:33: warning[-Wanalyzer-malloc-leak]: leak of ‘tty’
shadow-4.18.0/src/newgrp.c:233:13: enter_function: entry to ‘syslog_sg’
shadow-4.18.0/src/newgrp.c:243:12: branch_true: following ‘true’ branch (when ‘tty’ is non-NULL)...
shadow-4.18.0/src/newgrp.c:244:28: branch_true: ...to here
shadow-4.18.0/src/newgrp.c:244:28: call_function: calling ‘xstrdup’ from ‘syslog_sg’
shadow-4.18.0/src/newgrp.c:244:28: return_function: returning to ‘syslog_sg’ from ‘xstrdup’
shadow-4.18.0/src/newgrp.c:248:12: branch_true: following ‘true’ branch (when ‘loginname’ is NULL)...
shadow-4.18.0/src/newgrp.c:248:12: branch_true: ...to here
shadow-4.18.0/src/newgrp.c:251:12: branch_false: following ‘false’ branch (when ‘tty’ is non-NULL)...
shadow-4.18.0/src/newgrp.c:254:15: branch_false: ...to here
shadow-4.18.0/src/newgrp.c:254:15: call_function: calling ‘strprefix_’ from ‘syslog_sg’
shadow-4.18.0/src/newgrp.c:254:15: return_function: returning to ‘syslog_sg’ from ‘strprefix_’
shadow-4.18.0/src/newgrp.c:254:15: branch_true: following ‘true’ branch...
shadow-4.18.0/src/newgrp.c:256:9: branch_true: ...to here
shadow-4.18.0/src/newgrp.c:256:9: branch_false: following ‘false’ branch (when ‘saved_locale’ is NULL)...
shadow-4.18.0/src/newgrp.c:281:24: branch_false: ...to here
shadow-4.18.0/src/newgrp.c:291:20: branch_true: following ‘true’ branch (when ‘child == -1’)...
shadow-4.18.0/src/newgrp.c:294:73: branch_true: ...to here
shadow-4.18.0/src/newgrp.c:296:28: branch_true: following ‘true’ branch (when ‘group’ is non-NULL)...
shadow-4.18.0/src/newgrp.c:298:57: branch_true: ...to here
shadow-4.18.0/src/newgrp.c:297:33: throw: if ‘audit_logger_with_group’ throws an exception...
shadow-4.18.0/src/newgrp.c:297:33: danger: ‘tty’ leaks here; was allocated at [(7)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/6)
#  295|   #ifdef WITH_AUDIT
#  296|   			if (group) {
#  297|-> 				audit_logger_with_group(AUDIT_CHGRP_ID, "changing", NULL,
#  298|   							getuid(), "new_group", group,
#  299|   							SHADOW_AUDIT_FAILURE);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
shadow-4.18.0/src/newgrp.c:301:33: warning[-Wanalyzer-malloc-leak]: leak of ‘tty’
shadow-4.18.0/src/newgrp.c:233:13: enter_function: entry to ‘syslog_sg’
shadow-4.18.0/src/newgrp.c:243:12: branch_true: following ‘true’ branch (when ‘tty’ is non-NULL)...
shadow-4.18.0/src/newgrp.c:244:28: branch_true: ...to here
shadow-4.18.0/src/newgrp.c:244:28: call_function: calling ‘xstrdup’ from ‘syslog_sg’
shadow-4.18.0/src/newgrp.c:244:28: return_function: returning to ‘syslog_sg’ from ‘xstrdup’
shadow-4.18.0/src/newgrp.c:248:12: branch_true: following ‘true’ branch (when ‘loginname’ is NULL)...
shadow-4.18.0/src/newgrp.c:248:12: branch_true: ...to here
shadow-4.18.0/src/newgrp.c:251:12: branch_false: following ‘false’ branch (when ‘tty’ is non-NULL)...
shadow-4.18.0/src/newgrp.c:254:15: branch_false: ...to here
shadow-4.18.0/src/newgrp.c:254:15: call_function: calling ‘strprefix_’ from ‘syslog_sg’
shadow-4.18.0/src/newgrp.c:254:15: return_function: returning to ‘syslog_sg’ from ‘strprefix_’
shadow-4.18.0/src/newgrp.c:254:15: branch_true: following ‘true’ branch...
shadow-4.18.0/src/newgrp.c:256:9: branch_true: ...to here
shadow-4.18.0/src/newgrp.c:256:9: branch_false: following ‘false’ branch (when ‘saved_locale’ is NULL)...
shadow-4.18.0/src/newgrp.c:281:24: branch_false: ...to here
shadow-4.18.0/src/newgrp.c:291:20: branch_true: following ‘true’ branch (when ‘child == -1’)...
shadow-4.18.0/src/newgrp.c:294:73: branch_true: ...to here
shadow-4.18.0/src/newgrp.c:296:28: branch_false: following ‘false’ branch (when ‘group’ is NULL)...
shadow-4.18.0/src/newgrp.c:302:65: branch_false: ...to here
shadow-4.18.0/src/newgrp.c:301:33: throw: if ‘audit_logger’ throws an exception...
shadow-4.18.0/src/newgrp.c:301:33: danger: ‘tty’ leaks here; was allocated at [(7)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/6)
#  299|   							SHADOW_AUDIT_FAILURE);
#  300|   			} else {
#  301|-> 				audit_logger (AUDIT_CHGRP_ID, Prog,
#  302|   				              "changing", NULL, getuid(),
#  303|   				              SHADOW_AUDIT_FAILURE);

Scan Properties

analyzer-version-clippy1.92.0
analyzer-version-cppcheck2.19.1
analyzer-version-gcc16.0.0
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.92.0
diffbase-analyzer-version-cppcheck2.19.1
diffbase-analyzer-version-gcc16.0.0
diffbase-analyzer-version-gcc-analyzer16.0.0
diffbase-analyzer-version-shellcheck0.11.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-222.us-west-2.compute.internal
diffbase-known-false-positives/usr/share/csmock/known-false-positives.js
diffbase-known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-nameshadow-utils-4.18.0-3.fc43
diffbase-store-results-to/tmp/tmpk9012n5g/shadow-utils-4.18.0-3.fc43.tar.xz
diffbase-time-created2026-01-08 21:41:16
diffbase-time-finished2026-01-08 21:44:43
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpk9012n5g/shadow-utils-4.18.0-3.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpk9012n5g/shadow-utils-4.18.0-3.fc43.src.rpm'
diffbase-tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-222.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-nameshadow-utils-4.18.0-7.fc44
store-results-to/tmp/tmpdynbloaw/shadow-utils-4.18.0-7.fc44.tar.xz
time-created2026-01-08 21:45:22
time-finished2026-01-08 21:48:25
titleNewly introduced findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpdynbloaw/shadow-utils-4.18.0-7.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpdynbloaw/shadow-utils-4.18.0-7.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9