Newly introduced findings

List of Findings

Error: COMPILER_WARNING: [#def1]
libimobiledevice-1.4.0/cython/imobiledevice.c: warning: -Wno-implicit-function-declaration detected - is this intentional ?

Error: CPPCHECK_WARNING (CWE-476): [#def2]
libimobiledevice-1.4.0/src/idevice.c:541: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: new_connection
#  539|   		idevice_connection_t new_connection = (idevice_connection_t)malloc(sizeof(struct idevice_connection_private));
#  540|   		new_connection->type = CONNECTION_USBMUXD;
#  541|-> 		new_connection->data = (void*)(uintptr_t)sfd;
#  542|   		new_connection->ssl_data = NULL;
#  543|   		new_connection->device = device;

Error: CPPCHECK_WARNING (CWE-476): [#def3]
libimobiledevice-1.4.0/src/idevice.c:586: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: new_connection
#  584|   		idevice_connection_t new_connection = (idevice_connection_t)malloc(sizeof(struct idevice_connection_private));
#  585|   		new_connection->type = CONNECTION_NETWORK;
#  586|-> 		new_connection->data = (void*)(uintptr_t)sfd;
#  587|   		new_connection->ssl_data = NULL;
#  588|   		new_connection->device = device;

Error: CPPCHECK_WARNING (CWE-476): [#def4]
libimobiledevice-1.4.0/src/ostrace.c:90: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: client_loc
#   88|   
#   89|   	ostrace_client_t client_loc = (ostrace_client_t) malloc(sizeof(struct ostrace_client_private));
#   90|-> 	client_loc->parent = parent;
#   91|   	client_loc->worker = THREAD_T_NULL;
#   92|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def5]
libimobiledevice-1.4.0/src/ostrace.c:90:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'client_loc'
libimobiledevice-1.4.0/src/ostrace.c:71:17: enter_function: entry to 'ostrace_client_new'
libimobiledevice-1.4.0/src/ostrace.c:75:12: branch_false: following 'false' branch...
libimobiledevice-1.4.0/src/ostrace.c:83:31: call_function: inlined call to 'ostrace_error' from 'ostrace_client_new'
libimobiledevice-1.4.0/src/ostrace.c:84:12: branch_false: following 'false' branch...
libimobiledevice-1.4.0/src/ostrace.c:89:58: branch_false: ...to here
libimobiledevice-1.4.0/src/ostrace.c:89:58: acquire_memory: this call could return NULL
libimobiledevice-1.4.0/src/ostrace.c:90:9: danger: 'client_loc' could be NULL: unchecked value from [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#   88|   
#   89|   	ostrace_client_t client_loc = (ostrace_client_t) malloc(sizeof(struct ostrace_client_private));
#   90|-> 	client_loc->parent = parent;
#   91|   	client_loc->worker = THREAD_T_NULL;
#   92|   

Error: CPPCHECK_WARNING (CWE-476): [#def6]
libimobiledevice-1.4.0/src/ostrace.c:91: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: client_loc
#   89|   	ostrace_client_t client_loc = (ostrace_client_t) malloc(sizeof(struct ostrace_client_private));
#   90|   	client_loc->parent = parent;
#   91|-> 	client_loc->worker = THREAD_T_NULL;
#   92|   
#   93|   	*client = client_loc;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def7]
libimobiledevice-1.4.0/tools/afcclient.c:237:13: warning[-Wanalyzer-malloc-leak]: leak of ‘get_absolute_path(path)’
libimobiledevice-1.4.0/tools/afcclient.c:1426:5: enter_function: entry to ‘main’
libimobiledevice-1.4.0/tools/afcclient.c:1514:25: branch_true: following ‘true’ branch...
libimobiledevice-1.4.0/tools/afcclient.c:1515:28: branch_true: ...to here
libimobiledevice-1.4.0/tools/afcclient.c:1522:12: branch_false: following ‘false’ branch (when ‘count != 0’)...
libimobiledevice-1.4.0/tools/afcclient.c:1527:9: branch_false: ...to here
libimobiledevice-1.4.0/tools/afcclient.c:1529:16: branch_true: following ‘true’ branch...
libimobiledevice-1.4.0/tools/afcclient.c:1529:30: branch_true: ...to here
libimobiledevice-1.4.0/tools/afcclient.c:1536:12: branch_false: following ‘false’ branch...
libimobiledevice-1.4.0/tools/afcclient.c:1540:69: branch_false: ...to here
libimobiledevice-1.4.0/tools/afcclient.c:1541:12: branch_false: following ‘false’ branch...
libimobiledevice-1.4.0/tools/afcclient.c:1551:52: branch_false: ...to here
libimobiledevice-1.4.0/tools/afcclient.c:1551:20: branch_false: following ‘false’ branch...
libimobiledevice-1.4.0/tools/afcclient.c:1557:20: branch_false: ...to here
libimobiledevice-1.4.0/tools/afcclient.c:1557:20: branch_false: following ‘false’ branch (when ‘appid’ is NULL)...
libimobiledevice-1.4.0/tools/afcclient.c:1561:25: branch_false: ...to here
libimobiledevice-1.4.0/tools/afcclient.c:1562:20: branch_false: following ‘false’ branch...
libimobiledevice-1.4.0/tools/afcclient.c:1568:20: branch_false: ...to here
libimobiledevice-1.4.0/tools/afcclient.c:1568:20: branch_false: following ‘false’ branch (when ‘appid’ is NULL)...
libimobiledevice-1.4.0/tools/afcclient.c:1602:25: branch_false: ...to here
libimobiledevice-1.4.0/tools/afcclient.c:1611:20: branch_true: following ‘true’ branch (when ‘argc > 0’)...
libimobiledevice-1.4.0/tools/afcclient.c:1613:25: branch_true: ...to here
libimobiledevice-1.4.0/tools/afcclient.c:1613:25: call_function: calling ‘process_args’ from ‘main’
#  235|   static char* get_absolute_path(const char *path)
#  236|   {
#  237|-> 	if (*path == '/') {
#  238|   		return strdup(path);
#  239|   	} else {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def8]
libimobiledevice-1.4.0/tools/afcclient.c:1111:26: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘srcpath’ where non-null expected
libimobiledevice-1.4.0/tools/afcclient.c:1426:5: enter_function: entry to ‘main’
libimobiledevice-1.4.0/tools/afcclient.c:1514:25: branch_true: following ‘true’ branch...
libimobiledevice-1.4.0/tools/afcclient.c:1515:28: branch_true: ...to here
libimobiledevice-1.4.0/tools/afcclient.c:1522:12: branch_false: following ‘false’ branch (when ‘count != 0’)...
libimobiledevice-1.4.0/tools/afcclient.c:1527:9: branch_false: ...to here
libimobiledevice-1.4.0/tools/afcclient.c:1529:16: branch_true: following ‘true’ branch...
libimobiledevice-1.4.0/tools/afcclient.c:1529:30: branch_true: ...to here
libimobiledevice-1.4.0/tools/afcclient.c:1536:12: branch_false: following ‘false’ branch...
libimobiledevice-1.4.0/tools/afcclient.c:1540:69: branch_false: ...to here
libimobiledevice-1.4.0/tools/afcclient.c:1541:12: branch_false: following ‘false’ branch...
libimobiledevice-1.4.0/tools/afcclient.c:1551:52: branch_false: ...to here
libimobiledevice-1.4.0/tools/afcclient.c:1551:20: branch_false: following ‘false’ branch...
libimobiledevice-1.4.0/tools/afcclient.c:1557:20: branch_false: ...to here
libimobiledevice-1.4.0/tools/afcclient.c:1557:20: branch_false: following ‘false’ branch (when ‘appid’ is NULL)...
libimobiledevice-1.4.0/tools/afcclient.c:1561:25: branch_false: ...to here
libimobiledevice-1.4.0/tools/afcclient.c:1562:20: branch_false: following ‘false’ branch...
libimobiledevice-1.4.0/tools/afcclient.c:1568:20: branch_false: ...to here
libimobiledevice-1.4.0/tools/afcclient.c:1568:20: branch_false: following ‘false’ branch (when ‘appid’ is NULL)...
libimobiledevice-1.4.0/tools/afcclient.c:1602:25: branch_false: ...to here
libimobiledevice-1.4.0/tools/afcclient.c:1611:20: branch_true: following ‘true’ branch (when ‘argc > 0’)...
libimobiledevice-1.4.0/tools/afcclient.c:1613:25: branch_true: ...to here
libimobiledevice-1.4.0/tools/afcclient.c:1613:25: call_function: calling ‘process_args’ from ‘main’
# 1109|   	}
# 1110|   	char *srcpath = strdup(argv[i]);
# 1111|-> 	size_t src_len = strlen(srcpath);
# 1112|   	if (src_len > 1 && srcpath[src_len - 1] == '/') {
# 1113|   		srcpath[src_len - 1] = '\0';

Error: GCC_ANALYZER_WARNING (CWE-688): [#def9]
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:331:72: warning[-Wanalyzer-null-argument]: use of NULL ‘image_sig_path’ where non-null expected
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:185:15: release_memory: ‘image_sig_path’ is NULL
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:195:12: branch_false: following ‘false’ branch (when ‘argc != 0’)...
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:201:15: branch_false: ...to here
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:257:12: branch_false: following ‘false’ branch...
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:266:44: branch_false: ...to here
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:266:12: branch_false: following ‘false’ branch...
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:271:39: branch_false: ...to here
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:294:12: branch_false: following ‘false’ branch...
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:299:12: branch_false: following ‘false’ branch...
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:304:13: branch_false: ...to here
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:309:12: branch_true: following ‘true’ branch...
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:311:20: branch_true: ...to here
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:311:20: branch_false: following ‘false’ branch (when ‘disk_image_upload_type != 0’)...
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:326:21: branch_false: ...to here
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:326:20: branch_false: following ‘false’ branch...
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:330:30: branch_false: ...to here
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:331:20: branch_true: following ‘true’ branch...
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:331:72: branch_true: ...to here
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:331:72: release_memory: ‘image_sig_path’ is NULL
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:331:72: danger: argument 1 (‘image_sig_path’) NULL where non-null expected
#  329|   		}
#  330|   		image_size = fst.st_size;
#  331|-> 		if (device_version < IDEVICE_DEVICE_VERSION(17,0,0) && stat(image_sig_path, &fst) != 0) {
#  332|   			fprintf(stderr, "ERROR: stat: %s: %s\n", image_sig_path, strerror(errno));
#  333|   			goto leave;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def10]
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:331:72: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘image_sig_path’ where non-null expected
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:195:12: branch_false: following ‘false’ branch (when ‘argc != 0’)...
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:201:15: branch_false: ...to here
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:231:28: branch_false: following ‘false’ branch (when ‘argc > 0’)...
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:236:38: branch_false: ...to here
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:237:28: branch_true: following ‘true’ branch (when ‘argc != 1’)...
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:238:50: branch_true: ...to here
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:238:50: acquire_memory: this call could return NULL
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:257:12: branch_false: following ‘false’ branch...
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:266:44: branch_false: ...to here
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:266:12: branch_false: following ‘false’ branch...
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:271:39: branch_false: ...to here
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:294:12: branch_false: following ‘false’ branch...
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:299:12: branch_false: following ‘false’ branch...
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:304:13: branch_false: ...to here
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:309:12: branch_true: following ‘true’ branch...
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:311:20: branch_true: ...to here
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:311:20: branch_false: following ‘false’ branch (when ‘disk_image_upload_type != 0’)...
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:326:21: branch_false: ...to here
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:326:20: branch_false: following ‘false’ branch...
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:330:30: branch_false: ...to here
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:331:20: branch_true: following ‘true’ branch...
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:331:72: branch_true: ...to here
libimobiledevice-1.4.0/tools/ideviceimagemounter.c:331:72: danger: argument 1 (‘image_sig_path’) from [(9)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/8) could be NULL where non-null expected
#  329|   		}
#  330|   		image_size = fst.st_size;
#  331|-> 		if (device_version < IDEVICE_DEVICE_VERSION(17,0,0) && stat(image_sig_path, &fst) != 0) {
#  332|   			fprintf(stderr, "ERROR: stat: %s: %s\n", image_sig_path, strerror(errno));
#  333|   			goto leave;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def11]
libimobiledevice-1.4.0/tools/idevicesyslog.c:787:33: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘elem’
libimobiledevice-1.4.0/tools/idevicesyslog.c:915:5: enter_function: entry to ‘main’
libimobiledevice-1.4.0/tools/idevicesyslog.c:1117:12: branch_false: following ‘false’ branch...
libimobiledevice-1.4.0/tools/idevicesyslog.c:1123:13: branch_false: ...to here
libimobiledevice-1.4.0/tools/idevicesyslog.c:1123:12: branch_false: following ‘false’ branch...
libimobiledevice-1.4.0/tools/idevicesyslog.c:1128:13: branch_false: ...to here
libimobiledevice-1.4.0/tools/idevicesyslog.c:1128:12: branch_false: following ‘false’ branch...
libimobiledevice-1.4.0/tools/idevicesyslog.c:1134:12: branch_false: ...to here
libimobiledevice-1.4.0/tools/idevicesyslog.c:1156:12: branch_false: following ‘false’ branch...
libimobiledevice-1.4.0/tools/idevicesyslog.c:1160:14: branch_false: ...to here
libimobiledevice-1.4.0/tools/idevicesyslog.c:1163:12: branch_true: following ‘true’ branch (when ‘argc > 0’)...
libimobiledevice-1.4.0/tools/idevicesyslog.c:1164:22: branch_true: ...to here
libimobiledevice-1.4.0/tools/idevicesyslog.c:1164:20: branch_true: following ‘true’ branch (when the strings are equal)...
libimobiledevice-1.4.0/tools/idevicesyslog.c:1165:29: branch_true: ...to here
libimobiledevice-1.4.0/tools/idevicesyslog.c:1165:29: call_function: calling ‘connect_service’ from ‘main’
libimobiledevice-1.4.0/tools/idevicesyslog.c:1165:29: return_function: returning to ‘main’ from ‘connect_service’
libimobiledevice-1.4.0/tools/idevicesyslog.c:1165:28: branch_false: following ‘false’ branch...
libimobiledevice-1.4.0/tools/idevicesyslog.c:1168:33: branch_false: ...to here
libimobiledevice-1.4.0/tools/idevicesyslog.c:1174:28: branch_false: following ‘false’ branch...
libimobiledevice-1.4.0/tools/idevicesyslog.c:1177:25: branch_false: ...to here
libimobiledevice-1.4.0/tools/idevicesyslog.c:1177:25: call_function: calling ‘print_sorted_pidlist’ from ‘main’
#  785|   				int pidval = (int)strtol(key, NULL, 10);
#  786|   				struct listelem* elem = (struct listelem*)malloc(sizeof(struct listelem));
#  787|-> 				elem->val = pidval;
#  788|   				elem->next = NULL;
#  789|   				struct listelem* prev = NULL;

Scan Properties

analyzer-version-clippy1.95.0
analyzer-version-cppcheck2.20.0
analyzer-version-gcc16.1.1
analyzer-version-gcc-analyzer16.1.1
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.95.0
diffbase-analyzer-version-cppcheck2.20.0
diffbase-analyzer-version-gcc16.1.1
diffbase-analyzer-version-gcc-analyzer16.1.1
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-178.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.20260524.213755.g3c6d0be.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-namelibimobiledevice-1.3.0^20240916gited9703d-7.fc44
diffbase-store-results-to/tmp/tmp4ydv6mpp/libimobiledevice-1.3.0^20240916gited9703d-7.fc44.tar.xz
diffbase-time-created2026-06-01 14:35:27
diffbase-time-finished2026-06-01 14:37:27
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'shellcheck,cppcheck,clippy,unicontrol,gcc' '-o' '/tmp/tmp4ydv6mpp/libimobiledevice-1.3.0^20240916gited9703d-7.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp4ydv6mpp/libimobiledevice-1.3.0^20240916gited9703d-7.fc44.src.rpm'
diffbase-tool-versioncsmock-3.8.5.20260529.133039.g6f3b5c6-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-178.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-namelibimobiledevice-1.4.0-3.fc45
store-results-to/tmp/tmpv9v3fltg/libimobiledevice-1.4.0-3.fc45.tar.xz
time-created2026-06-01 14:37:50
time-finished2026-06-01 14:39:58
titleNewly introduced findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'shellcheck,cppcheck,clippy,unicontrol,gcc' '-o' '/tmp/tmpv9v3fltg/libimobiledevice-1.4.0-3.fc45.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpv9v3fltg/libimobiledevice-1.4.0-3.fc45.src.rpm'
tool-versioncsmock-3.8.5.20260529.133039.g6f3b5c6-1.el9