libcamera-0.5.2-4.fc44

List of Findings

Error: CPPCHECK_WARNING (CWE-562): [#def1]
libcamera-v0.5.2/src/apps/cam/capture_script.cpp:586: error[returnDanglingLifetime]: Returning object that points to local variable 'values' that will be invalid when returning.
#  584|   	}
#  585|   
#  586|-> 	return value;
#  587|   }
#  588|   

Error: CPPCHECK_WARNING (CWE-628): [#def2]
libcamera-v0.5.2/src/libcamera/base/object.cpp:117: warning[eraseIteratorOutOfBoundsCond]: Either the condition 'it!=parent_->children_.end()' is redundant or function 'erase()' is called on the iterator 'it' which is out of bounds.
#  115|   				    parent_->children_.end(), this);
#  116|   		ASSERT(it != parent_->children_.end());
#  117|-> 		parent_->children_.erase(it);
#  118|   	}
#  119|   

Error: CPPCHECK_WARNING (CWE-457): [#def3]
libcamera-v0.5.2/src/libcamera/control_serializer.cpp:394: error[uninitvar]: Uninitialized variable: type
#  392|   	ControlValue value;
#  393|   
#  394|-> 	value.reserve(type, isArray, count);
#  395|   	buffer.read(value.data());
#  396|   

Error: CPPCHECK_WARNING (CWE-476): [#def4]
libcamera-v0.5.2/src/libcamera/pipeline/ipu3/ipu3.cpp:594: warning[nullPointer]: Possible null pointer dereference: mainCfg
#  592|   	 */
#  593|   	if (!vfCfg) {
#  594|-> 		ret = imgu->configureViewfinder(*mainCfg, &outputFormat);
#  595|   		if (ret)
#  596|   			return ret;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def5]
libcamera-v0.5.2/utils/ipu3/ipu3-pack.c:47:26: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(argv[1], 0)’
libcamera-v0.5.2/utils/ipu3/ipu3-pack.c:32:12: branch_false: following ‘false’ branch (when ‘argc == 3’)...
libcamera-v0.5.2/utils/ipu3/ipu3-pack.c:37:17: branch_false: ...to here
libcamera-v0.5.2/utils/ipu3/ipu3-pack.c:37:17: acquire_resource: opened here
libcamera-v0.5.2/utils/ipu3/ipu3-pack.c:38:12: branch_false: following ‘false’ branch...
libcamera-v0.5.2/utils/ipu3/ipu3-pack.c:44:13: branch_false: ...to here
libcamera-v0.5.2/utils/ipu3/ipu3-pack.c:44:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
libcamera-v0.5.2/utils/ipu3/ipu3-pack.c:47:26: branch_false: ...to here
libcamera-v0.5.2/utils/ipu3/ipu3-pack.c:47:26: danger: ‘open(argv[1], 0)’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   45|   		out_fd = STDOUT_FILENO;
#   46|   	} else {
#   47|-> 		out_fd = open(argv[2], O_WRONLY | O_TRUNC | O_CREAT, 0644);
#   48|   		if (out_fd == -1) {
#   49|   			fprintf(stderr, "Failed to open output file '%s': %s\n",

Error: GCC_ANALYZER_WARNING (CWE-775): [#def6]
libcamera-v0.5.2/utils/ipu3/ipu3-pack.c:87:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(argv[1], 0)’
libcamera-v0.5.2/utils/ipu3/ipu3-pack.c:32:12: branch_false: following ‘false’ branch (when ‘argc == 3’)...
libcamera-v0.5.2/utils/ipu3/ipu3-pack.c:37:17: branch_false: ...to here
libcamera-v0.5.2/utils/ipu3/ipu3-pack.c:37:17: acquire_resource: opened here
libcamera-v0.5.2/utils/ipu3/ipu3-pack.c:38:12: branch_false: following ‘false’ branch...
libcamera-v0.5.2/utils/ipu3/ipu3-pack.c:44:13: branch_false: ...to here
libcamera-v0.5.2/utils/ipu3/ipu3-pack.c:62:20: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
libcamera-v0.5.2/utils/ipu3/ipu3-pack.c:68:21: branch_false: ...to here
libcamera-v0.5.2/utils/ipu3/ipu3-pack.c:68:20: branch_false: following ‘false’ branch...
 branch_false: ...to here
libcamera-v0.5.2/utils/ipu3/ipu3-pack.c:75:29: branch_true: following ‘true’ branch (when ‘i != 30’)...
libcamera-v0.5.2/utils/ipu3/ipu3-pack.c:76:46: branch_true: ...to here
libcamera-v0.5.2/utils/ipu3/ipu3-pack.c:75:29: branch_false: following ‘false’ branch (when ‘i == 30’)...
libcamera-v0.5.2/utils/ipu3/ipu3-pack.c:84:33: branch_false: ...to here
libcamera-v0.5.2/utils/ipu3/ipu3-pack.c:87:23: danger: ‘open(argv[1], 0)’ leaks here; was opened at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#   85|   		out_data[31] = (in_data[24] >> 8) & 0x03;
#   86|   
#   87|-> 		ret = write(out_fd, out_data, sizeof(out_data));
#   88|   		if (ret < 0) {
#   89|   			fprintf(stderr, "Failed to write output data: %s\n",

Error: GCC_ANALYZER_WARNING (CWE-775): [#def7]
libcamera-v0.5.2/utils/ipu3/ipu3-pack.c:97:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(argv[1], 0)’
libcamera-v0.5.2/utils/ipu3/ipu3-pack.c:32:12: branch_false: following ‘false’ branch (when ‘argc == 3’)...
libcamera-v0.5.2/utils/ipu3/ipu3-pack.c:37:17: branch_false: ...to here
libcamera-v0.5.2/utils/ipu3/ipu3-pack.c:37:17: acquire_resource: opened here
libcamera-v0.5.2/utils/ipu3/ipu3-pack.c:38:12: branch_false: following ‘false’ branch...
libcamera-v0.5.2/utils/ipu3/ipu3-pack.c:44:13: branch_false: ...to here
libcamera-v0.5.2/utils/ipu3/ipu3-pack.c:97:12: danger: ‘open(argv[1], 0)’ leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#   95|   done:
#   96|   	close(in_fd);
#   97|-> 	if (out_fd != STDOUT_FILENO)
#   98|   		close(out_fd);
#   99|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def8]
libcamera-v0.5.2/utils/ipu3/ipu3-unpack.c:43:18: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(argv[1], 0)’
libcamera-v0.5.2/utils/ipu3/ipu3-unpack.c:31:12: branch_false: following ‘false’ branch (when ‘argc == 3’)...
libcamera-v0.5.2/utils/ipu3/ipu3-unpack.c:36:17: branch_false: ...to here
libcamera-v0.5.2/utils/ipu3/ipu3-unpack.c:36:17: acquire_resource: opened here
libcamera-v0.5.2/utils/ipu3/ipu3-unpack.c:37:12: branch_false: following ‘false’ branch...
libcamera-v0.5.2/utils/ipu3/ipu3-unpack.c:43:18: branch_false: ...to here
libcamera-v0.5.2/utils/ipu3/ipu3-unpack.c:43:18: danger: ‘open(argv[1], 0)’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   41|   	}
#   42|   
#   43|-> 	out_fd = open(argv[2], O_WRONLY | O_TRUNC | O_CREAT, 0644);
#   44|   	if (out_fd == -1) {
#   45|   		fprintf(stderr, "Failed to open output file '%s': %s\n",

Error: GCC_ANALYZER_WARNING (CWE-775): [#def9]
libcamera-v0.5.2/utils/ipu3/ipu3-unpack.c:81:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(argv[1], 0)’
libcamera-v0.5.2/utils/ipu3/ipu3-unpack.c:31:12: branch_false: following ‘false’ branch (when ‘argc == 3’)...
libcamera-v0.5.2/utils/ipu3/ipu3-unpack.c:36:17: branch_false: ...to here
libcamera-v0.5.2/utils/ipu3/ipu3-unpack.c:36:17: acquire_resource: opened here
libcamera-v0.5.2/utils/ipu3/ipu3-unpack.c:37:12: branch_false: following ‘false’ branch...
libcamera-v0.5.2/utils/ipu3/ipu3-unpack.c:43:18: branch_false: ...to here
libcamera-v0.5.2/utils/ipu3/ipu3-unpack.c:44:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
libcamera-v0.5.2/utils/ipu3/ipu3-unpack.c:56:20: branch_false: following ‘false’ branch (when ‘ret != -1’)...
libcamera-v0.5.2/utils/ipu3/ipu3-unpack.c:62:20: branch_false: ...to here
libcamera-v0.5.2/utils/ipu3/ipu3-unpack.c:62:20: branch_false: following ‘false’ branch (when ‘ret > 31’)...
 branch_false: ...to here
libcamera-v0.5.2/utils/ipu3/ipu3-unpack.c:69:29: branch_true: following ‘true’ branch (when ‘i != 25’)...
libcamera-v0.5.2/utils/ipu3/ipu3-unpack.c:70:46: branch_true: ...to here
libcamera-v0.5.2/utils/ipu3/ipu3-unpack.c:69:29: branch_false: following ‘false’ branch (when ‘i == 25’)...
libcamera-v0.5.2/utils/ipu3/ipu3-unpack.c:81:23: branch_false: ...to here
libcamera-v0.5.2/utils/ipu3/ipu3-unpack.c:81:23: danger: ‘open(argv[1], 0)’ leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#   79|   		}
#   80|   
#   81|-> 		ret = write(out_fd, out_data, 50);
#   82|   		if (ret == -1) {
#   83|   			fprintf(stderr, "Failed to write output data: %s\n",

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
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-176.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-namelibcamera-0.5.2-4.fc44
store-results-to/tmp/tmpxv3a6gqq/libcamera-0.5.2-4.fc44.tar.xz
time-created2025-10-28 18:55:25
time-finished2025-10-28 18:59:07
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'gcc,cppcheck,shellcheck,clippy,unicontrol' '-o' '/tmp/tmpxv3a6gqq/libcamera-0.5.2-4.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpxv3a6gqq/libcamera-0.5.2-4.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251027.143044.ge6b947b-1.el9