Fixed findings

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-416): [#def1]
audit-userspace-4.1.1/auparse/lru.c:222:13: warning[-Wanalyzer-use-after-free]: use after 'free' of 'node'
audit-userspace-4.1.1/auparse/lru.c:395:6: enter_function: entry to 'destroy_lru'
audit-userspace-4.1.1/auparse/lru.c:397:12: branch_false: following 'false' branch (when 'queue' is non-NULL)...
audit-userspace-4.1.1/auparse/lru.c:400:9: branch_false: ...to here
audit-userspace-4.1.1/auparse/lru.c:401:9: call_function: calling 'destroy_queue' from 'destroy_lru'
#  220|   	// If we are at the beginning
#  221|   	sanity_check_queue(queue, "1 remove_node");
#  222|-> 	if (node->prev == NULL) {
#  223|   		queue->front = node->next;
#  224|   		if (queue->front)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2]
audit-userspace-4.1.1/common/common.c:75:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open("/dev/console", 1)'
audit-userspace-4.1.1/common/common.c:71:19: acquire_resource: opened here
audit-userspace-4.1.1/common/common.c:71:12: branch_false: following 'false' branch...
audit-userspace-4.1.1/common/common.c:74:9: branch_false: ...to here
audit-userspace-4.1.1/common/common.c:75:13: danger: 'open("/dev/console", 1)' leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   73|   
#   74|   	va_start(args, fmt);
#   75|-> 	if (vdprintf(fd, fmt, args) < 0) {
#   76|   		res = 0;
#   77|   	}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def3]
audit-userspace-4.1.1/common/common.c:75:13: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
audit-userspace-4.1.1/common/common.c:71:12: branch_false: following 'false' branch...
audit-userspace-4.1.1/common/common.c:74:9: branch_false: ...to here
audit-userspace-4.1.1/common/common.c:74:9: acquire_resource: 'va_start' called here
audit-userspace-4.1.1/common/common.c:75:13: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#   73|   
#   74|   	va_start(args, fmt);
#   75|-> 	if (vdprintf(fd, fmt, args) < 0) {
#   76|   		res = 0;
#   77|   	}

Error: COMPILER_WARNING: [#def4]
audit-userspace-4.1.1/common/message.c:29: included_from: Included from here.
audit-userspace-4.1.1/lib/private.h:138:53: warning: 'struct audit_rule_data' declared inside parameter list will not be visible outside of this definition or declaration
#  138 | int _audit_parse_syscall(const char *optarg, struct audit_rule_data *rule);
#      |                                                     ^~~~~~~~~~~~~~~
#  136|   
#  137|   // libaudit.c
#  138|-> int _audit_parse_syscall(const char *optarg, struct audit_rule_data *rule);
#  139|   extern int _audit_permadded;
#  140|   extern int _audit_archadded;

Error: COMPILER_WARNING: [#def5]
audit-userspace-4.1.1/lib/private.h:138:53: warning[warning]: 'struct audit_rule_data' declared inside parameter list will not be visible outside of this definition or declaration
#  136|   
#  137|   // libaudit.c
#  138|-> int _audit_parse_syscall(const char *optarg, struct audit_rule_data *rule);
#  139|   extern int _audit_permadded;
#  140|   extern int _audit_archadded;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
audit-userspace-4.1.1/src/auditd-config.c:1118:33: warning[-Wanalyzer-malloc-leak]: leak of ‘tmail’
audit-userspace-4.1.1/src/auditd-config.c:1136:12: enter_function: entry to ‘action_mail_acct_parser’
audit-userspace-4.1.1/src/auditd-config.c:1143:17: acquire_memory: allocated here
audit-userspace-4.1.1/src/auditd-config.c:1144:12: branch_false: following ‘false’ branch (when ‘tmail’ is non-NULL)...
audit-userspace-4.1.1/src/auditd-config.c:1147:13: branch_false: ...to here
audit-userspace-4.1.1/src/auditd-config.c:1147:12: branch_true: following ‘true’ branch...
audit-userspace-4.1.1/src/auditd-config.c:1147:37: branch_true: ...to here
audit-userspace-4.1.1/src/auditd-config.c:1147:37: call_function: calling ‘validate_email’ from ‘action_mail_acct_parser’
# 1116|   			if ((h_errno == HOST_NOT_FOUND) ||
# 1117|   						(h_errno == NO_RECOVERY)) {
# 1118|-> 				audit_msg(LOG_ERR,
# 1119|   			"validate_email: failed looking up host for %s (%s)",
# 1120|   					ptr1+1, gai_strerror(rc2));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def7]
audit-userspace-4.1.1/src/auditd-config.c:1125:33: warning[-Wanalyzer-malloc-leak]: leak of ‘tmail’
audit-userspace-4.1.1/src/auditd-config.c:1136:12: enter_function: entry to ‘action_mail_acct_parser’
audit-userspace-4.1.1/src/auditd-config.c:1143:17: acquire_memory: allocated here
audit-userspace-4.1.1/src/auditd-config.c:1144:12: branch_false: following ‘false’ branch (when ‘tmail’ is non-NULL)...
audit-userspace-4.1.1/src/auditd-config.c:1147:13: branch_false: ...to here
audit-userspace-4.1.1/src/auditd-config.c:1147:12: branch_true: following ‘true’ branch...
audit-userspace-4.1.1/src/auditd-config.c:1147:37: branch_true: ...to here
audit-userspace-4.1.1/src/auditd-config.c:1147:37: call_function: calling ‘validate_email’ from ‘action_mail_acct_parser’
# 1123|   				// now treat all as temp failure.
# 1124|   			} else if (h_errno == TRY_AGAIN) {
# 1125|-> 				audit_msg(LOG_DEBUG,
# 1126|   		"validate_email: temporary failure looking up domain for %s",
# 1127|   					ptr1+1);

Scan Properties

analyzer-version-clippy1.90.0
analyzer-version-cppcheck2.18.3
analyzer-version-gcc15.2.1
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.90.0
diffbase-analyzer-version-cppcheck2.18.3
diffbase-analyzer-version-gcc15.2.1
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-gcc-latest-x86_64
diffbase-project-nameaudit-4.1.2-2.fc44
diffbase-store-results-to/tmp/tmpcf8nh50b/audit-4.1.2-2.fc44.tar.xz
diffbase-time-created2025-10-28 17:31:55
diffbase-time-finished2025-10-28 17:34:53
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'gcc,cppcheck,shellcheck,clippy,unicontrol' '-o' '/tmp/tmpcf8nh50b/audit-4.1.2-2.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpcf8nh50b/audit-4.1.2-2.fc44.src.rpm'
diffbase-tool-versioncsmock-3.8.3.20251027.143044.ge6b947b-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-gcc-latest-x86_64
project-nameaudit-4.1.1-2.fc43
store-results-to/tmp/tmpj9ead0eh/audit-4.1.1-2.fc43.tar.xz
time-created2025-10-28 17:28:09
time-finished2025-10-28 17:31:33
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'gcc,cppcheck,shellcheck,clippy,unicontrol' '-o' '/tmp/tmpj9ead0eh/audit-4.1.1-2.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpj9ead0eh/audit-4.1.1-2.fc43.src.rpm'
tool-versioncsmock-3.8.3.20251027.143044.ge6b947b-1.el9