libusb1-1.0.29-4.fc44

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1]
libusb-1.0.29/examples/dpfp.c:328:20: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
libusb-1.0.29/examples/dpfp.c:320:30: acquire_memory: allocated here
libusb-1.0.29/examples/dpfp.c:323:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
libusb-1.0.29/examples/dpfp.c:328:20: branch_false: ...to here
libusb-1.0.29/examples/dpfp.c:328:20: throw: if ‘libusb_alloc_transfer’ throws an exception...
libusb-1.0.29/examples/dpfp.c:328:20: danger: ‘buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  326|   	}
#  327|   
#  328|-> 	transfer = libusb_alloc_transfer(0);
#  329|   	if (!transfer) {
#  330|   		free(buf);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
libusb-1.0.29/examples/ezusb.c:131:17: warning[-Wanalyzer-malloc-leak]: leak of ‘dImageBuf’
libusb-1.0.29/examples/ezusb.c:576:12: enter_function: entry to ‘fx3_load_ram’
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:640:26: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:639:21: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:645:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:645:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:649:40: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:649:40: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:650:20: branch_false: following ‘false’ branch (when ‘dImageBuf’ is non-NULL)...
libusb-1.0.29/examples/ezusb.c:657:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:657:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:657:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:672:30: call_function: calling ‘ezusb_write’ from ‘fx3_load_ram’
#  129|   
#  130|   	if (verbose > 1)
#  131|-> 		logerror("%s, addr 0x%08x len %4u (0x%04x)\n", label, addr, (unsigned)len, (unsigned)len);
#  132|   	status = libusb_control_transfer(device,
#  133|   		LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
libusb-1.0.29/examples/ezusb.c:132:18: warning[-Wanalyzer-malloc-leak]: leak of ‘dImageBuf’
libusb-1.0.29/examples/ezusb.c:576:12: enter_function: entry to ‘fx3_load_ram’
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:640:26: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:639:21: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:645:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:645:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:649:40: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:649:40: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:650:20: branch_false: following ‘false’ branch (when ‘dImageBuf’ is non-NULL)...
libusb-1.0.29/examples/ezusb.c:657:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:657:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:657:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:672:30: call_function: calling ‘ezusb_write’ from ‘fx3_load_ram’
#  130|   	if (verbose > 1)
#  131|   		logerror("%s, addr 0x%08x len %4u (0x%04x)\n", label, addr, (unsigned)len, (unsigned)len);
#  132|-> 	status = libusb_control_transfer(device,
#  133|   		LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE,
#  134|   		opcode, addr & 0xFFFF, addr >> 16,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def4]
libusb-1.0.29/examples/ezusb.c:588:20: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:588:19: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/ezusb.c:589:17: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:589:17: throw: if ‘logerror’ throws an exception...
libusb-1.0.29/examples/ezusb.c:588:20: danger: ‘fopen(path, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  586|   		logerror("unable to open '%s' for input\n", path);
#  587|   		return -2;
#  588|-> 	} else if (verbose)
#  589|   		logerror("open firmware image %s for RAM upload\n", path);
#  590|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def5]
libusb-1.0.29/examples/ezusb.c:588:20: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:584:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:588:19: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/ezusb.c:589:17: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:589:17: throw: if ‘logerror’ throws an exception...
libusb-1.0.29/examples/ezusb.c:588:20: danger: ‘fopen(path, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  586|   		logerror("unable to open '%s' for input\n", path);
#  587|   		return -2;
#  588|-> 	} else if (verbose)
#  589|   		logerror("open firmware image %s for RAM upload\n", path);
#  590|   

Error: GCC_ANALYZER_WARNING (CWE-789): [#def6]
libusb-1.0.29/examples/ezusb.c:649:40: warning[-Wanalyzer-tainted-allocation-size]: use of attacker-controlled value ‘(long unsigned int)dLength * 4’ as allocation size without upper-bounds checking
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:640:26: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:639:21: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:645:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:645:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:649:40: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:649:40: danger: use of attacker-controlled value ‘(long unsigned int)dLength * 4’ as allocation size without upper-bounds checking
#  647|   
#  648|   		// coverity[tainted_data]
#  649|-> 		dImageBuf = (uint32_t*)calloc(dLength, sizeof(uint32_t));
#  650|   		if (dImageBuf == NULL) {
#  651|   			logerror("could not allocate buffer for image chunk\n");

Error: GCC_ANALYZER_WARNING (CWE-129): [#def7]
libusb-1.0.29/examples/ezusb.c:649:40: warning[-Wanalyzer-tainted-size]: use of attacker-controlled value ‘(long unsigned int)dLength * 4’ as size without upper-bounds checking
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:640:26: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:639:21: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:645:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:645:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:649:40: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:649:40: danger: use of attacker-controlled value ‘(long unsigned int)dLength * 4’ as size without upper-bounds checking
#  647|   
#  648|   		// coverity[tainted_data]
#  649|-> 		dImageBuf = (uint32_t*)calloc(dLength, sizeof(uint32_t));
#  650|   		if (dImageBuf == NULL) {
#  651|   			logerror("could not allocate buffer for image chunk\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def8]
libusb-1.0.29/examples/ezusb.c:658:25: warning[-Wanalyzer-malloc-leak]: leak of ‘dImageBuf’
libusb-1.0.29/examples/ezusb.c:585:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:588:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:592:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:599:14: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:599:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:639:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:640:26: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:639:21: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:645:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:645:20: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:649:40: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:649:40: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:650:20: branch_false: following ‘false’ branch (when ‘dImageBuf’ is non-NULL)...
libusb-1.0.29/examples/ezusb.c:657:21: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:658:25: throw: if ‘logerror’ throws an exception...
libusb-1.0.29/examples/ezusb.c:658:25: danger: ‘dImageBuf’ leaks here; was allocated at [(15)](sarif:/runs/0/results/66/codeFlows/0/threadFlows/0/locations/14)
#  656|   		// read sections
#  657|   		if (fread(dImageBuf, sizeof(uint32_t), dLength, image) != dLength) {
#  658|-> 			logerror("could not read image");
#  659|   			free(dImageBuf);
#  660|   			ret = -3;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def9]
libusb-1.0.29/examples/ezusb.c:745:20: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:738:12: branch_false: following ‘false’ branch (when ‘fx_type != 4’)...
libusb-1.0.29/examples/ezusb.c:741:17: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:741:17: acquire_resource: opened here
libusb-1.0.29/examples/ezusb.c:742:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:745:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:745:19: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/ezusb.c:746:17: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:746:17: throw: if ‘logerror’ throws an exception...
libusb-1.0.29/examples/ezusb.c:745:20: danger: ‘fopen(path, "rb")’ leaks here; was opened at [(3)](sarif:/runs/0/results/67/codeFlows/0/threadFlows/0/locations/2)
#  743|   		logerror("%s: unable to open for input.\n", path);
#  744|   		return -2;
#  745|-> 	} else if (verbose > 1)
#  746|   		logerror("open firmware image %s for RAM upload\n", path);
#  747|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def10]
libusb-1.0.29/examples/ezusb.c:745:20: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(path, "rb")’
libusb-1.0.29/examples/ezusb.c:738:12: branch_false: following ‘false’ branch (when ‘fx_type != 4’)...
libusb-1.0.29/examples/ezusb.c:741:17: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:741:17: acquire_memory: allocated here
libusb-1.0.29/examples/ezusb.c:742:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/ezusb.c:745:20: branch_false: ...to here
libusb-1.0.29/examples/ezusb.c:745:19: branch_true: following ‘true’ branch...
libusb-1.0.29/examples/ezusb.c:746:17: branch_true: ...to here
libusb-1.0.29/examples/ezusb.c:746:17: throw: if ‘logerror’ throws an exception...
libusb-1.0.29/examples/ezusb.c:745:20: danger: ‘fopen(path, "rb")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/68/codeFlows/0/threadFlows/0/locations/2)
#  743|   		logerror("%s: unable to open for input.\n", path);
#  744|   		return -2;
#  745|-> 	} else if (verbose > 1)
#  746|   		logerror("open firmware image %s for RAM upload\n", path);
#  747|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def11]
libusb-1.0.29/examples/testlibusb.c:252:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(device_name, 2)’
libusb-1.0.29/examples/testlibusb.c:247:14: acquire_resource: opened here
libusb-1.0.29/examples/testlibusb.c:248:12: branch_false: following ‘false’ branch...
libusb-1.0.29/examples/testlibusb.c:252:13: branch_false: ...to here
libusb-1.0.29/examples/testlibusb.c:252:13: throw: if ‘libusb_wrap_sys_device’ throws an exception...
libusb-1.0.29/examples/testlibusb.c:252:13: danger: ‘open(device_name, 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  250|   		return 1;
#  251|   	}
#  252|-> 	r = libusb_wrap_sys_device(NULL, fd, &handle);
#  253|   	if (r) {
#  254|   		printf("Error wrapping device: %s: %s\n", device_name, libusb_strerror(r));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def12]
libusb-1.0.29/libusb/core.c:2227:17: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
libusb-1.0.29/libusb/core.c:2216:13: enter_function: entry to 'libusb_set_log_cb_internal'
libusb-1.0.29/libusb/core.c:2226:23: call_function: calling 'usbi_get_context' from 'libusb_set_log_cb_internal'
libusb-1.0.29/libusb/core.c:2226:23: return_function: returning to 'libusb_set_log_cb_internal' from 'usbi_get_context'
libusb-1.0.29/libusb/core.c:2227:17: danger: dereference of NULL 'usbi_get_context(ctx)'
# 2225|   	if (mode & LIBUSB_LOG_CB_CONTEXT) {
# 2226|   		ctx = usbi_get_context(ctx);
# 2227|-> 		ctx->log_handler = cb;
# 2228|   	}
# 2229|   #else

Error: GCC_ANALYZER_WARNING (CWE-404): [#def13]
libusb-1.0.29/libusb/core.c:2354:37: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libusb-1.0.29/libusb/core.c:2422:18: enter_function: entry to 'libusb_init_context'
libusb-1.0.29/libusb/core.c:2428:9: call_function: calling 'usbi_mutex_static_lock' from 'libusb_init_context'
libusb-1.0.29/libusb/core.c:2428:9: return_function: returning to 'libusb_init_context' from 'usbi_mutex_static_lock'
libusb-1.0.29/libusb/core.c:2438:9: call_function: calling 'usbi_mutex_static_lock' from 'libusb_init_context'
libusb-1.0.29/libusb/core.c:2438:9: return_function: returning to 'libusb_init_context' from 'usbi_mutex_static_lock'
libusb-1.0.29/libusb/core.c:2443:9: call_function: calling 'usbi_mutex_static_unlock' from 'libusb_init_context'
libusb-1.0.29/libusb/core.c:2443:9: return_function: returning to 'libusb_init_context' from 'usbi_mutex_static_unlock'
libusb-1.0.29/libusb/core.c:2446:12: branch_false: following 'false' branch (when '_ctx' is non-NULL)...
libusb-1.0.29/libusb/core.c:2452:9: branch_false: ...to here
libusb-1.0.29/libusb/core.c:2461:9: call_function: calling 'usbi_mutex_init' from 'libusb_init_context'
libusb-1.0.29/libusb/core.c:2461:9: return_function: returning to 'libusb_init_context' from 'usbi_mutex_init'
libusb-1.0.29/libusb/core.c:2462:9: call_function: calling 'usbi_mutex_init' from 'libusb_init_context'
libusb-1.0.29/libusb/core.c:2462:9: return_function: returning to 'libusb_init_context' from 'usbi_mutex_init'
libusb-1.0.29/libusb/core.c:2467:46: branch_true: following 'true' branch (when 'option != 4')...
libusb-1.0.29/libusb/core.c:2468:20: branch_true: ...to here
libusb-1.0.29/libusb/core.c:2468:20: branch_true: following 'true' branch (when 'option == 0')...
libusb-1.0.29/libusb/core.c:2468:20: branch_true: ...to here
libusb-1.0.29/libusb/core.c:2467:46: branch_true: following 'true' branch (when 'option != 4')...
libusb-1.0.29/libusb/core.c:2468:20: branch_true: ...to here
libusb-1.0.29/libusb/core.c:2471:20: branch_true: following 'true' branch (when 'option != 3')...
libusb-1.0.29/libusb/core.c:2472:29: branch_true: ...to here
libusb-1.0.29/libusb/core.c:2472:29: call_function: calling 'libusb_set_option' from 'libusb_init_context'
# 2352|   		case LIBUSB_OPTION_NO_DEVICE_DISCOVERY:
# 2353|   			if (usbi_backend.set_option) {
# 2354|-> 				r = usbi_backend.set_option(ctx, option, ap);
# 2355|   				break;
# 2356|   			}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def14]
libusb-1.0.29/libusb/core.c:2743:17: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libusb-1.0.29/libusb/core.c:2845:6: enter_function: entry to 'usbi_log'
libusb-1.0.29/libusb/core.c:2850:9: acquire_resource: 'va_start' called here
libusb-1.0.29/libusb/core.c:2851:9: call_function: calling 'log_v' from 'usbi_log'
# 2741|   	/* Global log handler */
# 2742|   	if (log_handler)
# 2743|-> 		log_handler(NULL, level, str);
# 2744|   	else
# 2745|   		fputs(str, stderr);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def15]
libusb-1.0.29/libusb/core.c:2809:30: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libusb-1.0.29/libusb/core.c:2845:6: enter_function: entry to 'usbi_log'
libusb-1.0.29/libusb/core.c:2850:9: acquire_resource: 'va_start' called here
libusb-1.0.29/libusb/core.c:2851:9: call_function: calling 'log_v' from 'usbi_log'
# 2807|   		TIMESPEC_SUB(&timestamp, &timestamp_origin, &timestamp);
# 2808|   
# 2809|-> 		header_len = snprintf(buf, sizeof(buf),
# 2810|   			"[%2ld.%06ld] [%08lx] libusb: %s [%s] ",
# 2811|   			(long)timestamp.tv_sec, (long)(timestamp.tv_nsec / 1000L), usbi_get_tid(), prefix, function);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def16]
libusb-1.0.29/libusb/descriptor.c:61:17: warning[-Wanalyzer-malloc-leak]: leak of '_config'
libusb-1.0.29/libusb/descriptor.c:629:18: enter_function: entry to 'libusb_get_config_descriptor_by_value'
libusb-1.0.29/libusb/descriptor.c:635:12: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:638:21: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:640:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:643:24: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:643:24: call_function: calling 'raw_desc_to_config' from 'libusb_get_config_descriptor_by_value'
#   59|   
#   60|   	if (size < DESC_HEADER_LENGTH) {
#   61|-> 		usbi_err(ctx, "short endpoint descriptor read %d/%d",
#   62|   			 size, DESC_HEADER_LENGTH);
#   63|   		return LIBUSB_ERROR_IO;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def17]
libusb-1.0.29/libusb/descriptor.c:68:17: warning[-Wanalyzer-malloc-leak]: leak of '_config'
libusb-1.0.29/libusb/descriptor.c:629:18: enter_function: entry to 'libusb_get_config_descriptor_by_value'
libusb-1.0.29/libusb/descriptor.c:635:12: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:638:21: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:640:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:643:24: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:643:24: call_function: calling 'raw_desc_to_config' from 'libusb_get_config_descriptor_by_value'
#   66|   	header = (const struct usbi_descriptor_header *)buffer;
#   67|   	if (header->bDescriptorType != LIBUSB_DT_ENDPOINT) {
#   68|-> 		usbi_err(ctx, "unexpected descriptor 0x%x (expected 0x%x)",
#   69|   			header->bDescriptorType, LIBUSB_DT_ENDPOINT);
#   70|   		return parsed;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def18]
libusb-1.0.29/libusb/descriptor.c:72:17: warning[-Wanalyzer-malloc-leak]: leak of '_config'
libusb-1.0.29/libusb/descriptor.c:629:18: enter_function: entry to 'libusb_get_config_descriptor_by_value'
libusb-1.0.29/libusb/descriptor.c:635:12: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:638:21: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:640:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:643:24: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:643:24: call_function: calling 'raw_desc_to_config' from 'libusb_get_config_descriptor_by_value'
#   70|   		return parsed;
#   71|   	} else if (header->bLength < LIBUSB_DT_ENDPOINT_SIZE) {
#   72|-> 		usbi_err(ctx, "invalid endpoint bLength (%u)", header->bLength);
#   73|   		return LIBUSB_ERROR_IO;
#   74|   	} else if (header->bLength > size) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def19]
libusb-1.0.29/libusb/descriptor.c:75:17: warning[-Wanalyzer-malloc-leak]: leak of '_config'
libusb-1.0.29/libusb/descriptor.c:629:18: enter_function: entry to 'libusb_get_config_descriptor_by_value'
libusb-1.0.29/libusb/descriptor.c:635:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:646:9: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:647:23: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:650:21: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:651:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:654:21: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:655:32: call_function: calling 'libusb_get_config_descriptor' from 'libusb_get_config_descriptor_by_value'
#   73|   		return LIBUSB_ERROR_IO;
#   74|   	} else if (header->bLength > size) {
#   75|-> 		usbi_warn(ctx, "short endpoint descriptor read %d/%u",
#   76|   			  size, header->bLength);
#   77|   		return parsed;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def20]
libusb-1.0.29/libusb/descriptor.c:337:17: warning[-Wanalyzer-malloc-leak]: leak of '_config'
libusb-1.0.29/libusb/descriptor.c:629:18: enter_function: entry to 'libusb_get_config_descriptor_by_value'
libusb-1.0.29/libusb/descriptor.c:635:12: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:638:21: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:640:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:643:24: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:643:24: call_function: calling 'raw_desc_to_config' from 'libusb_get_config_descriptor_by_value'
#  335|   
#  336|   	if (size < LIBUSB_DT_CONFIG_SIZE) {
#  337|-> 		usbi_err(ctx, "short config descriptor read %d/%d",
#  338|   			 size, LIBUSB_DT_CONFIG_SIZE);
#  339|   		return LIBUSB_ERROR_IO;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def21]
libusb-1.0.29/libusb/descriptor.c:351:17: warning[-Wanalyzer-malloc-leak]: leak of '_config'
libusb-1.0.29/libusb/descriptor.c:629:18: enter_function: entry to 'libusb_get_config_descriptor_by_value'
libusb-1.0.29/libusb/descriptor.c:635:12: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:638:21: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:640:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:643:24: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:643:24: call_function: calling 'raw_desc_to_config' from 'libusb_get_config_descriptor_by_value'
#  349|   	config->MaxPower = buffer[8];
#  350|   	if (config->bDescriptorType != LIBUSB_DT_CONFIG) {
#  351|-> 		usbi_err(ctx, "unexpected descriptor 0x%x (expected 0x%x)",
#  352|   			 config->bDescriptorType, LIBUSB_DT_CONFIG);
#  353|   		return LIBUSB_ERROR_IO;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def22]
libusb-1.0.29/libusb/descriptor.c:355:17: warning[-Wanalyzer-malloc-leak]: leak of '_config'
libusb-1.0.29/libusb/descriptor.c:629:18: enter_function: entry to 'libusb_get_config_descriptor_by_value'
libusb-1.0.29/libusb/descriptor.c:635:12: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:638:21: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:640:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:643:24: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:643:24: call_function: calling 'raw_desc_to_config' from 'libusb_get_config_descriptor_by_value'
#  353|   		return LIBUSB_ERROR_IO;
#  354|   	} else if (config->bLength < LIBUSB_DT_CONFIG_SIZE) {
#  355|-> 		usbi_err(ctx, "invalid config bLength (%u)", config->bLength);
#  356|   		return LIBUSB_ERROR_IO;
#  357|   	} else if (config->bLength > size) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def23]
libusb-1.0.29/libusb/descriptor.c:358:17: warning[-Wanalyzer-malloc-leak]: leak of '_config'
libusb-1.0.29/libusb/descriptor.c:629:18: enter_function: entry to 'libusb_get_config_descriptor_by_value'
libusb-1.0.29/libusb/descriptor.c:635:12: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:638:21: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:640:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:643:24: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:643:24: call_function: calling 'raw_desc_to_config' from 'libusb_get_config_descriptor_by_value'
#  356|   		return LIBUSB_ERROR_IO;
#  357|   	} else if (config->bLength > size) {
#  358|-> 		usbi_err(ctx, "short config descriptor read %d/%u",
#  359|   			 size, config->bLength);
#  360|   		return LIBUSB_ERROR_IO;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def24]
libusb-1.0.29/libusb/descriptor.c:362:17: warning[-Wanalyzer-malloc-leak]: leak of '_config'
libusb-1.0.29/libusb/descriptor.c:629:18: enter_function: entry to 'libusb_get_config_descriptor_by_value'
libusb-1.0.29/libusb/descriptor.c:635:12: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:638:21: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:640:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:643:24: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:643:24: call_function: calling 'raw_desc_to_config' from 'libusb_get_config_descriptor_by_value'
#  360|   		return LIBUSB_ERROR_IO;
#  361|   	} else if (config->bNumInterfaces > USB_MAXINTERFACES) {
#  362|-> 		usbi_err(ctx, "too many interfaces (%u)", config->bNumInterfaces);
#  363|   		return LIBUSB_ERROR_IO;
#  364|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def25]
libusb-1.0.29/libusb/descriptor.c:470:17: warning[-Wanalyzer-malloc-leak]: leak of 'buf'
libusb-1.0.29/libusb/descriptor.c:1513:18: enter_function: entry to 'libusb_get_active_interface_association_descriptors'
libusb-1.0.29/libusb/descriptor.c:1521:12: branch_false: following 'false' branch (when 'iad_array' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:1524:13: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:1525:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:1528:41: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:1529:15: acquire_memory: allocated here
libusb-1.0.29/libusb/descriptor.c:1530:12: branch_false: following 'false' branch (when 'buf' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:1533:13: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:1533:13: call_function: calling 'get_active_config_descriptor' from 'libusb_get_active_interface_association_descriptors'
#  468|   	uint8_t *buffer, size_t size)
#  469|   {
#  470|-> 	int r = usbi_backend.get_active_config_descriptor(dev, buffer, size);
#  471|   
#  472|   	if (r < 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def26]
libusb-1.0.29/libusb/descriptor.c:490:17: warning[-Wanalyzer-malloc-leak]: leak of 'buf'
libusb-1.0.29/libusb/descriptor.c:1464:18: enter_function: entry to 'libusb_get_interface_association_descriptors'
libusb-1.0.29/libusb/descriptor.c:1472:12: branch_false: following 'false' branch (when 'iad_array' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:1475:9: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:1476:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:1479:13: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:1480:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:1483:41: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:1484:15: acquire_memory: allocated here
libusb-1.0.29/libusb/descriptor.c:1485:12: branch_false: following 'false' branch (when 'buf' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:1488:13: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:1488:13: call_function: calling 'get_config_descriptor' from 'libusb_get_interface_association_descriptors'
#  488|   	uint8_t *buffer, size_t size)
#  489|   {
#  490|-> 	int r = usbi_backend.get_config_descriptor(dev, config_idx, buffer, size);
#  491|   
#  492|   	if (r < 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def27]
libusb-1.0.29/libusb/descriptor.c:794:25: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
libusb-1.0.29/libusb/descriptor.c:760:12: branch_false: following 'false' branch (when 'size > 4')...
libusb-1.0.29/libusb/descriptor.c:767:13: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:767:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:771:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:771:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:774:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:774:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:780:42: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:781:12: branch_false: following 'false' branch (when '_bos' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:784:9: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:792:21: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:793:20: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:793:20: branch_false: following 'false' branch (when 'size > 2')...
libusb-1.0.29/libusb/descriptor.c:799:21: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:799:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:803:28: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:803:27: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:808:28: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:808:27: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:814:43: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:814:43: acquire_memory: allocated here
libusb-1.0.29/libusb/descriptor.c:815:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:819:17: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:792:21: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:793:20: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:793:20: branch_true: following 'true' branch (when 'size <= 2')...
libusb-1.0.29/libusb/descriptor.c:794:25: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:794:25: throw: if 'usbi_log' throws an exception...
libusb-1.0.29/libusb/descriptor.c:794:25: danger: '<unknown>' leaks here; was allocated at [(21)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/20)
#  792|   	for (i = 0; i < _bos->bNumDeviceCaps; i++) {
#  793|   		if (size < LIBUSB_DT_DEVICE_CAPABILITY_SIZE) {
#  794|-> 			usbi_warn(ctx, "short dev-cap descriptor read %d/%d",
#  795|   				  size, LIBUSB_DT_DEVICE_CAPABILITY_SIZE);
#  796|   			break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def28]
libusb-1.0.29/libusb/descriptor.c:794:25: warning[-Wanalyzer-malloc-leak]: leak of '_bos'
libusb-1.0.29/libusb/descriptor.c:760:12: branch_false: following 'false' branch (when 'size > 4')...
libusb-1.0.29/libusb/descriptor.c:767:13: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:767:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:771:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:771:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:774:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:774:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:780:42: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:780:16: acquire_memory: allocated here
libusb-1.0.29/libusb/descriptor.c:781:12: branch_false: following 'false' branch (when '_bos' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:784:9: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:792:21: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:793:20: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:793:20: branch_true: following 'true' branch (when 'size <= 2')...
libusb-1.0.29/libusb/descriptor.c:794:25: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:794:25: throw: if 'usbi_log' throws an exception...
libusb-1.0.29/libusb/descriptor.c:794:25: danger: '_bos' leaks here; was allocated at [(9)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/8)
#  792|   	for (i = 0; i < _bos->bNumDeviceCaps; i++) {
#  793|   		if (size < LIBUSB_DT_DEVICE_CAPABILITY_SIZE) {
#  794|-> 			usbi_warn(ctx, "short dev-cap descriptor read %d/%d",
#  795|   				  size, LIBUSB_DT_DEVICE_CAPABILITY_SIZE);
#  796|   			break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def29]
libusb-1.0.29/libusb/descriptor.c:800:25: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
libusb-1.0.29/libusb/descriptor.c:760:12: branch_false: following 'false' branch (when 'size > 4')...
libusb-1.0.29/libusb/descriptor.c:767:13: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:767:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:771:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:771:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:774:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:774:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:780:42: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:781:12: branch_false: following 'false' branch (when '_bos' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:784:9: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:792:21: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:793:20: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:793:20: branch_false: following 'false' branch (when 'size > 2')...
libusb-1.0.29/libusb/descriptor.c:799:21: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:799:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:803:28: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:803:27: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:808:28: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:808:27: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:814:43: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:814:43: acquire_memory: allocated here
libusb-1.0.29/libusb/descriptor.c:815:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:819:17: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:792:21: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:793:20: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:793:20: branch_false: following 'false' branch (when 'size > 2')...
libusb-1.0.29/libusb/descriptor.c:799:21: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:799:20: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:800:25: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:800:25: throw: if 'usbi_log' throws an exception...
libusb-1.0.29/libusb/descriptor.c:800:25: danger: '<unknown>' leaks here; was allocated at [(21)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/20)
#  798|   		header = (const struct usbi_descriptor_header *)buffer;
#  799|   		if (header->bDescriptorType != LIBUSB_DT_DEVICE_CAPABILITY) {
#  800|-> 			usbi_warn(ctx, "unexpected descriptor 0x%x (expected 0x%x)",
#  801|   				  header->bDescriptorType, LIBUSB_DT_DEVICE_CAPABILITY);
#  802|   			break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def30]
libusb-1.0.29/libusb/descriptor.c:800:25: warning[-Wanalyzer-malloc-leak]: leak of '_bos'
libusb-1.0.29/libusb/descriptor.c:760:12: branch_false: following 'false' branch (when 'size > 4')...
libusb-1.0.29/libusb/descriptor.c:767:13: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:767:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:771:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:771:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:774:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:774:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:780:42: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:780:16: acquire_memory: allocated here
libusb-1.0.29/libusb/descriptor.c:781:12: branch_false: following 'false' branch (when '_bos' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:784:9: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:792:21: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:793:20: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:793:20: branch_false: following 'false' branch (when 'size > 2')...
libusb-1.0.29/libusb/descriptor.c:799:21: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:799:20: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:800:25: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:800:25: throw: if 'usbi_log' throws an exception...
libusb-1.0.29/libusb/descriptor.c:800:25: danger: '_bos' leaks here; was allocated at [(9)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/8)
#  798|   		header = (const struct usbi_descriptor_header *)buffer;
#  799|   		if (header->bDescriptorType != LIBUSB_DT_DEVICE_CAPABILITY) {
#  800|-> 			usbi_warn(ctx, "unexpected descriptor 0x%x (expected 0x%x)",
#  801|   				  header->bDescriptorType, LIBUSB_DT_DEVICE_CAPABILITY);
#  802|   			break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def31]
libusb-1.0.29/libusb/descriptor.c:804:25: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
libusb-1.0.29/libusb/descriptor.c:760:12: branch_false: following 'false' branch (when 'size > 4')...
libusb-1.0.29/libusb/descriptor.c:767:13: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:767:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:771:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:771:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:774:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:774:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:780:42: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:781:12: branch_false: following 'false' branch (when '_bos' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:784:9: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:792:21: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:793:20: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:793:20: branch_false: following 'false' branch (when 'size > 2')...
libusb-1.0.29/libusb/descriptor.c:799:21: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:799:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:803:28: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:803:27: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:808:28: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:808:27: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:814:43: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:814:43: acquire_memory: allocated here
libusb-1.0.29/libusb/descriptor.c:815:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:819:17: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:792:21: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:793:20: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:793:20: branch_false: following 'false' branch (when 'size > 2')...
libusb-1.0.29/libusb/descriptor.c:799:21: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:799:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:803:28: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:803:27: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:804:25: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:804:25: throw: if 'usbi_log' throws an exception...
libusb-1.0.29/libusb/descriptor.c:804:25: danger: '<unknown>' leaks here; was allocated at [(21)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/20)
#  802|   			break;
#  803|   		} else if (header->bLength < LIBUSB_DT_DEVICE_CAPABILITY_SIZE) {
#  804|-> 			usbi_err(ctx, "invalid dev-cap bLength (%u)",
#  805|   				 header->bLength);
#  806|   			libusb_free_bos_descriptor(_bos);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def32]
libusb-1.0.29/libusb/descriptor.c:804:25: warning[-Wanalyzer-malloc-leak]: leak of '_bos'
libusb-1.0.29/libusb/descriptor.c:760:12: branch_false: following 'false' branch (when 'size > 4')...
libusb-1.0.29/libusb/descriptor.c:767:13: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:767:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:771:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:771:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:774:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:774:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:780:42: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:780:16: acquire_memory: allocated here
libusb-1.0.29/libusb/descriptor.c:781:12: branch_false: following 'false' branch (when '_bos' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:784:9: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:792:21: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:793:20: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:793:20: branch_false: following 'false' branch (when 'size > 2')...
libusb-1.0.29/libusb/descriptor.c:799:21: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:799:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:803:28: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:803:27: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:804:25: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:804:25: throw: if 'usbi_log' throws an exception...
libusb-1.0.29/libusb/descriptor.c:804:25: danger: '_bos' leaks here; was allocated at [(9)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/8)
#  802|   			break;
#  803|   		} else if (header->bLength < LIBUSB_DT_DEVICE_CAPABILITY_SIZE) {
#  804|-> 			usbi_err(ctx, "invalid dev-cap bLength (%u)",
#  805|   				 header->bLength);
#  806|   			libusb_free_bos_descriptor(_bos);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def33]
libusb-1.0.29/libusb/descriptor.c:809:25: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
libusb-1.0.29/libusb/descriptor.c:760:12: branch_false: following 'false' branch (when 'size > 4')...
libusb-1.0.29/libusb/descriptor.c:767:13: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:767:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:771:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:771:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:774:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:774:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:780:42: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:781:12: branch_false: following 'false' branch (when '_bos' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:784:9: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:792:21: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:793:20: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:793:20: branch_false: following 'false' branch (when 'size > 2')...
libusb-1.0.29/libusb/descriptor.c:799:21: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:799:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:803:28: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:803:27: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:808:28: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:808:27: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:814:43: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:814:43: acquire_memory: allocated here
libusb-1.0.29/libusb/descriptor.c:815:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:819:17: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:792:21: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:793:20: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:793:20: branch_false: following 'false' branch (when 'size > 2')...
libusb-1.0.29/libusb/descriptor.c:799:21: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:799:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:803:28: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:803:27: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:808:28: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:808:27: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:809:25: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:809:25: throw: if 'usbi_log' throws an exception...
libusb-1.0.29/libusb/descriptor.c:809:25: danger: '<unknown>' leaks here; was allocated at [(21)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/20)
#  807|   			return LIBUSB_ERROR_IO;
#  808|   		} else if (header->bLength > size) {
#  809|-> 			usbi_warn(ctx, "short dev-cap descriptor read %d/%u",
#  810|   				  size, header->bLength);
#  811|   			break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def34]
libusb-1.0.29/libusb/descriptor.c:809:25: warning[-Wanalyzer-malloc-leak]: leak of '_bos'
libusb-1.0.29/libusb/descriptor.c:760:12: branch_false: following 'false' branch (when 'size > 4')...
libusb-1.0.29/libusb/descriptor.c:767:13: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:767:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:771:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:771:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:774:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:774:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:780:42: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:780:16: acquire_memory: allocated here
libusb-1.0.29/libusb/descriptor.c:781:12: branch_false: following 'false' branch (when '_bos' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:784:9: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:792:21: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:793:20: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:793:20: branch_false: following 'false' branch (when 'size > 2')...
libusb-1.0.29/libusb/descriptor.c:799:21: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:799:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:803:28: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:803:27: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:808:28: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:808:27: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:809:25: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:809:25: throw: if 'usbi_log' throws an exception...
libusb-1.0.29/libusb/descriptor.c:809:25: danger: '_bos' leaks here; was allocated at [(9)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/8)
#  807|   			return LIBUSB_ERROR_IO;
#  808|   		} else if (header->bLength > size) {
#  809|-> 			usbi_warn(ctx, "short dev-cap descriptor read %d/%u",
#  810|   				  size, header->bLength);
#  811|   			break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def35]
libusb-1.0.29/libusb/descriptor.c:1100:17: warning[-Wanalyzer-malloc-leak]: leak of '_ssplus_cap'
libusb-1.0.29/libusb/descriptor.c:1053:18: enter_function: entry to 'libusb_get_ssplus_usb_device_capability_descriptor'
libusb-1.0.29/libusb/descriptor.c:1064:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:1069:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:1069:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:1080:41: call_function: inlined call to 'ReadLittleEndian32' from 'libusb_get_ssplus_usb_device_capability_descriptor'
libusb-1.0.29/libusb/descriptor.c:1085:23: acquire_memory: allocated here
libusb-1.0.29/libusb/descriptor.c:1086:12: branch_false: following 'false' branch (when '_ssplus_cap' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:1090:9: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:1099:12: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:1100:17: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:1100:17: throw: if 'usbi_log' throws an exception...
libusb-1.0.29/libusb/descriptor.c:1100:17: danger: '_ssplus_cap' leaks here; was allocated at [(7)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/6)
# 1098|   	/* Check that we have enough to read all the sublink attributes */
# 1099|   	if (dev_cap->bLength < LIBUSB_BT_SSPLUS_USB_DEVICE_CAPABILITY_SIZE + _ssplus_cap->numSublinkSpeedAttributes * sizeof(uint32_t)) {
# 1100|-> 		usbi_err(ctx, "short ssplus capability descriptor, unable to read sublinks: Not enough data");
# 1101|   		return LIBUSB_ERROR_IO;
# 1102|   	}

Error: CPPCHECK_WARNING (CWE-401): [#def36]
libusb-1.0.29/libusb/descriptor.c:1101: error[memleak]: Memory leak: _ssplus_cap
# 1099|   	if (dev_cap->bLength < LIBUSB_BT_SSPLUS_USB_DEVICE_CAPABILITY_SIZE + _ssplus_cap->numSublinkSpeedAttributes * sizeof(uint32_t)) {
# 1100|   		usbi_err(ctx, "short ssplus capability descriptor, unable to read sublinks: Not enough data");
# 1101|-> 		return LIBUSB_ERROR_IO;
# 1102|   	}
# 1103|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def37]
libusb-1.0.29/libusb/descriptor.c:1118:1: warning[-Wanalyzer-malloc-leak]: leak of '_ssplus_cap'
libusb-1.0.29/libusb/descriptor.c:1053:18: enter_function: entry to 'libusb_get_ssplus_usb_device_capability_descriptor'
libusb-1.0.29/libusb/descriptor.c:1064:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:1069:20: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:1069:19: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:1080:41: call_function: inlined call to 'ReadLittleEndian32' from 'libusb_get_ssplus_usb_device_capability_descriptor'
libusb-1.0.29/libusb/descriptor.c:1085:23: acquire_memory: allocated here
libusb-1.0.29/libusb/descriptor.c:1086:12: branch_false: following 'false' branch (when '_ssplus_cap' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:1090:9: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:1099:12: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:1100:17: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:1118:1: danger: '_ssplus_cap' leaks here; was allocated at [(7)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/6)
# 1116|   	*ssplus_usb_device_cap = _ssplus_cap;
# 1117|   	return LIBUSB_SUCCESS;
# 1118|-> }
# 1119|   
# 1120|   /** \ingroup libusb_desc

Error: GCC_ANALYZER_WARNING (CWE-401): [#def38]
libusb-1.0.29/libusb/descriptor.c:1361:17: warning[-Wanalyzer-malloc-leak]: leak of '_iad_array'
libusb-1.0.29/libusb/descriptor.c:1424:12: enter_function: entry to 'raw_desc_to_iad_array'
libusb-1.0.29/libusb/descriptor.c:1428:19: acquire_memory: allocated here
libusb-1.0.29/libusb/descriptor.c:1431:12: branch_false: following 'false' branch (when '_iad_array' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:1434:13: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:1434:13: call_function: calling 'parse_iad_array' from 'raw_desc_to_iad_array'
# 1359|   
# 1360|   	if (size < LIBUSB_DT_CONFIG_SIZE) {
# 1361|-> 		usbi_err(ctx, "short config descriptor read %d/%d",
# 1362|   			 size, LIBUSB_DT_CONFIG_SIZE);
# 1363|   		return LIBUSB_ERROR_IO;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def39]
libusb-1.0.29/libusb/descriptor.c:1372:25: warning[-Wanalyzer-malloc-leak]: leak of '_iad_array'
libusb-1.0.29/libusb/descriptor.c:1424:12: enter_function: entry to 'raw_desc_to_iad_array'
libusb-1.0.29/libusb/descriptor.c:1428:19: acquire_memory: allocated here
libusb-1.0.29/libusb/descriptor.c:1431:12: branch_false: following 'false' branch (when '_iad_array' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:1434:13: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:1434:13: call_function: calling 'parse_iad_array' from 'raw_desc_to_iad_array'
# 1370|   		header.bDescriptorType = buf[1];
# 1371|   		if (header.bLength < DESC_HEADER_LENGTH) {
# 1372|-> 			usbi_err(ctx, "invalid descriptor bLength %d",
# 1373|   				 header.bLength);
# 1374|   			return LIBUSB_ERROR_IO;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def40]
libusb-1.0.29/libusb/descriptor.c:1377:25: warning[-Wanalyzer-malloc-leak]: leak of '_iad_array'
libusb-1.0.29/libusb/descriptor.c:1424:12: enter_function: entry to 'raw_desc_to_iad_array'
libusb-1.0.29/libusb/descriptor.c:1428:19: acquire_memory: allocated here
libusb-1.0.29/libusb/descriptor.c:1431:12: branch_false: following 'false' branch (when '_iad_array' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:1434:13: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:1434:13: call_function: calling 'parse_iad_array' from 'raw_desc_to_iad_array'
# 1375|   		}
# 1376|   		else if (header.bLength > size) {
# 1377|-> 			usbi_warn(ctx, "short config descriptor read %d/%u",
# 1378|   					  size, header.bLength);
# 1379|   			return LIBUSB_ERROR_IO;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def41]
libusb-1.0.29/libusb/descriptor.c:1436:17: warning[-Wanalyzer-malloc-leak]: leak of '_iad_array'
libusb-1.0.29/libusb/descriptor.c:1424:12: enter_function: entry to 'raw_desc_to_iad_array'
libusb-1.0.29/libusb/descriptor.c:1428:19: acquire_memory: allocated here
libusb-1.0.29/libusb/descriptor.c:1431:12: branch_false: following 'false' branch (when '_iad_array' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:1434:13: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:1434:13: call_function: calling 'parse_iad_array' from 'raw_desc_to_iad_array'
libusb-1.0.29/libusb/descriptor.c:1434:13: return_function: returning to 'raw_desc_to_iad_array' from 'parse_iad_array'
libusb-1.0.29/libusb/descriptor.c:1435:12: branch_true: following 'true' branch...
libusb-1.0.29/libusb/descriptor.c:1436:17: branch_true: ...to here
libusb-1.0.29/libusb/descriptor.c:1436:17: throw: if 'usbi_log' throws an exception...
libusb-1.0.29/libusb/descriptor.c:1436:17: danger: '_iad_array' leaks here; was allocated at [(2)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/1)
# 1434|   	r = parse_iad_array(ctx, _iad_array, buf, size);
# 1435|   	if (r < 0) {
# 1436|-> 		usbi_err(ctx, "parse_iad_array failed with error %d", r);
# 1437|   		free(_iad_array);
# 1438|   		return r;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def42]
libusb-1.0.29/libusb/hotplug.c:389:30: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
libusb-1.0.29/libusb/hotplug.c:342:18: enter_function: entry to 'libusb_hotplug_register_callback'
libusb-1.0.29/libusb/hotplug.c:351:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/hotplug.c:351:13: branch_false: following 'false' branch...
libusb-1.0.29/libusb/hotplug.c:354:13: branch_false: ...to here
libusb-1.0.29/libusb/hotplug.c:351:13: branch_false: following 'false' branch...
libusb-1.0.29/libusb/hotplug.c:355:13: branch_false: ...to here
libusb-1.0.29/libusb/hotplug.c:351:13: branch_false: following 'false' branch...
libusb-1.0.29/libusb/hotplug.c:351:13: branch_false: ...to here
libusb-1.0.29/libusb/hotplug.c:351:13: branch_false: following 'false' branch (when 'cb_fn' is non-NULL)...
libusb-1.0.29/libusb/hotplug.c:361:14: branch_false: ...to here
libusb-1.0.29/libusb/hotplug.c:361:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/hotplug.c:364:15: branch_false: ...to here
libusb-1.0.29/libusb/hotplug.c:364:15: call_function: calling 'usbi_get_context' from 'libusb_hotplug_register_callback'
libusb-1.0.29/libusb/hotplug.c:364:15: return_function: returning to 'libusb_hotplug_register_callback' from 'usbi_get_context'
libusb-1.0.29/libusb/hotplug.c:367:12: branch_false: following 'false' branch (when 'hotplug_cb' is non-NULL)...
libusb-1.0.29/libusb/hotplug.c:370:29: branch_false: ...to here
libusb-1.0.29/libusb/hotplug.c:371:12: branch_false: following 'false' branch (when 'vendor_id == -1')...
libusb-1.0.29/libusb/hotplug.c:375:12: branch_false: ...to here
libusb-1.0.29/libusb/hotplug.c:375:12: branch_false: following 'false' branch (when 'product_id == -1')...
libusb-1.0.29/libusb/hotplug.c:379:12: branch_false: ...to here
libusb-1.0.29/libusb/hotplug.c:379:12: branch_false: following 'false' branch (when 'dev_class == -1')...
libusb-1.0.29/libusb/hotplug.c:383:9: branch_false: ...to here
libusb-1.0.29/libusb/hotplug.c:386:9: call_function: calling 'usbi_mutex_lock' from 'libusb_hotplug_register_callback'
libusb-1.0.29/libusb/hotplug.c:386:9: return_function: returning to 'libusb_hotplug_register_callback' from 'usbi_mutex_lock'
libusb-1.0.29/libusb/hotplug.c:389:30: danger: dereference of NULL 'usbi_get_context(ctx)'
#  387|   
#  388|   	/* protect the handle by the context hotplug lock */
#  389|-> 	hotplug_cb->handle = ctx->next_hotplug_cb_handle++;
#  390|   
#  391|   	/* handle the unlikely case of overflow */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def43]
libusb-1.0.29/libusb/hotplug.c:456:17: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
libusb-1.0.29/libusb/hotplug.c:427:19: enter_function: entry to 'libusb_hotplug_deregister_callback'
libusb-1.0.29/libusb/hotplug.c:439:15: call_function: calling 'usbi_get_context' from 'libusb_hotplug_deregister_callback'
libusb-1.0.29/libusb/hotplug.c:439:15: return_function: returning to 'libusb_hotplug_deregister_callback' from 'usbi_get_context'
libusb-1.0.29/libusb/hotplug.c:441:9: call_function: calling 'usbi_mutex_lock' from 'libusb_hotplug_deregister_callback'
libusb-1.0.29/libusb/hotplug.c:441:9: return_function: returning to 'libusb_hotplug_deregister_callback' from 'usbi_mutex_lock'
libusb-1.0.29/libusb/hotplug.c:442:9: branch_true: following 'true' branch...
libusb-1.0.29/libusb/hotplug.c:443:40: branch_true: ...to here
libusb-1.0.29/libusb/hotplug.c:450:9: call_function: calling 'usbi_mutex_unlock' from 'libusb_hotplug_deregister_callback'
libusb-1.0.29/libusb/hotplug.c:450:9: return_function: returning to 'libusb_hotplug_deregister_callback' from 'usbi_mutex_unlock'
libusb-1.0.29/libusb/hotplug.c:452:12: branch_true: following 'true' branch (when 'deregistered != 0')...
libusb-1.0.29/libusb/hotplug.c:455:17: branch_true: ...to here
libusb-1.0.29/libusb/hotplug.c:455:17: call_function: calling 'usbi_mutex_lock' from 'libusb_hotplug_deregister_callback'
libusb-1.0.29/libusb/hotplug.c:455:17: return_function: returning to 'libusb_hotplug_deregister_callback' from 'usbi_mutex_lock'
libusb-1.0.29/libusb/hotplug.c:456:17: danger: dereference of NULL 'usbi_get_context(ctx)'
#  454|   
#  455|   		usbi_mutex_lock(&ctx->event_data_lock);
#  456|-> 		event_flags = ctx->event_flags;
#  457|   		ctx->event_flags |= USBI_EVENT_HOTPLUG_CB_DEREGISTERED;
#  458|   		if (!event_flags)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def44]
libusb-1.0.29/libusb/io.c:2651:9: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
libusb-1.0.29/libusb/io.c:2645:19: enter_function: entry to 'libusb_set_pollfd_notifiers'
libusb-1.0.29/libusb/io.c:2650:15: call_function: calling 'usbi_get_context' from 'libusb_set_pollfd_notifiers'
libusb-1.0.29/libusb/io.c:2650:15: return_function: returning to 'libusb_set_pollfd_notifiers' from 'usbi_get_context'
libusb-1.0.29/libusb/io.c:2651:9: danger: dereference of NULL 'usbi_get_context(ctx)'
# 2649|   #if !defined(PLATFORM_WINDOWS)
# 2650|   	ctx = usbi_get_context(ctx);
# 2651|-> 	ctx->fd_added_cb = added_cb;
# 2652|   	ctx->fd_removed_cb = removed_cb;
# 2653|   	ctx->fd_cb_user_data = user_data;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def45]
libusb-1.0.29/libusb/io.c:2689:9: warning[-Wanalyzer-malloc-leak]: leak of 'ievent_source'
libusb-1.0.29/libusb/io.c:2684:51: acquire_memory: allocated here
libusb-1.0.29/libusb/io.c:2686:12: branch_false: following 'false' branch (when 'ievent_source' is non-NULL)...
libusb-1.0.29/libusb/io.c:2689:9: branch_false: ...to here
libusb-1.0.29/libusb/io.c:2689:9: throw: if 'usbi_log' throws an exception...
libusb-1.0.29/libusb/io.c:2689:9: danger: 'ievent_source' leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
# 2687|   		return LIBUSB_ERROR_NO_MEM;
# 2688|   
# 2689|-> 	usbi_dbg(ctx, "add " USBI_OS_HANDLE_FORMAT_STRING " events %d", os_handle, poll_events);
# 2690|   	ievent_source->data.os_handle = os_handle;
# 2691|   	ievent_source->data.poll_events = poll_events;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def46]
libusb-1.0.29/libusb/libusb.h:2174:16: warning[-Wanalyzer-malloc-leak]: leak of 'bos_data'
libusb-1.0.29/libusb/descriptor.c:840:18: enter_function: entry to 'libusb_get_bos_descriptor'
libusb-1.0.29/libusb/descriptor.c:847:38: branch_false: following 'false' branch (when 'dev_handle' is NULL)...
libusb-1.0.29/libusb/descriptor.c:851:13: call_function: inlined call to 'libusb_get_descriptor' from 'libusb_get_bos_descriptor'
libusb-1.0.29/libusb/descriptor.c:852:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:857:12: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:857:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/descriptor.c:863:38: branch_false: ...to here
libusb-1.0.29/libusb/descriptor.c:866:20: acquire_memory: allocated here
libusb-1.0.29/libusb/descriptor.c:867:12: branch_false: following 'false' branch (when 'bos_data' is non-NULL)...
libusb-1.0.29/libusb/descriptor.c:870:13: call_function: inlined call to 'libusb_get_descriptor' from 'libusb_get_bos_descriptor'
# 2172|   	uint8_t desc_type, uint8_t desc_index, unsigned char *data, int length)
# 2173|   {
# 2174|-> 	return libusb_control_transfer(dev_handle, LIBUSB_ENDPOINT_IN,
# 2175|   		LIBUSB_REQUEST_GET_DESCRIPTOR, (uint16_t) ((desc_type << 8) | desc_index),
# 2176|   		0, data, (uint16_t) length, 1000);

Error: CPPCHECK_WARNING (CWE-476): [#def47]
libusb-1.0.29/libusb/libusbi.h:497: error[ctunullpointer]: Null pointer dereference: ctx
#  495|   static inline int usbi_handling_events(struct libusb_context *ctx)
#  496|   {
#  497|-> 	return usbi_tls_key_get(ctx->event_handling_key) != NULL;
#  498|   }
#  499|   

Error: CPPCHECK_WARNING (CWE-476): [#def48]
libusb-1.0.29/libusb/libusbi.h:497: warning[nullPointer]: Possible null pointer dereference: ctx
#  495|   static inline int usbi_handling_events(struct libusb_context *ctx)
#  496|   {
#  497|-> 	return usbi_tls_key_get(ctx->event_handling_key) != NULL;
#  498|   }
#  499|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def49]
libusb-1.0.29/libusb/libusbi.h:497:16: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
libusb-1.0.29/libusb/sync.c:103:18: enter_function: entry to 'libusb_control_transfer'
libusb-1.0.29/libusb/sync.c:112:13: branch_false: following 'false' branch (when 'dev_handle' is NULL)...
libusb-1.0.29/libusb/sync.c:112:13: call_function: inlined call to 'usbi_handling_events' from 'libusb_control_transfer'
#  495|   static inline int usbi_handling_events(struct libusb_context *ctx)
#  496|   {
#  497|-> 	return usbi_tls_key_get(ctx->event_handling_key) != NULL;
#  498|   }
#  499|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def50]
libusb-1.0.29/libusb/os/events_posix.h:58:16: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
libusb-1.0.29/libusb/io.c:2573:18: enter_function: entry to 'libusb_get_next_timeout'
libusb-1.0.29/libusb/io.c:2580:15: call_function: calling 'usbi_get_context' from 'libusb_get_next_timeout'
libusb-1.0.29/libusb/io.c:2580:15: return_function: returning to 'libusb_get_next_timeout' from 'usbi_get_context'
libusb-1.0.29/libusb/io.c:2581:13: call_function: inlined call to 'usbi_using_timer' from 'libusb_get_next_timeout'
#   56|   static inline int usbi_timer_valid(usbi_timer_t *timer)
#   57|   {
#   58|-> 	return timer->timerfd >= 0;
#   59|   }
#   60|   #endif

Error: GCC_ANALYZER_WARNING (CWE-476): [#def51]
libusb-1.0.29/libusb/os/events_posix.h:58:16: warning[-Wanalyzer-null-dereference]: dereference of NULL 'ctx'
libusb-1.0.29/libusb/io.c:2491:18: enter_function: entry to 'libusb_handle_events_locked'
libusb-1.0.29/libusb/io.c:2497:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/io.c:2500:15: call_function: calling 'usbi_get_context' from 'libusb_handle_events_locked'
libusb-1.0.29/libusb/io.c:2500:15: return_function: returning to 'libusb_handle_events_locked' from 'usbi_get_context'
libusb-1.0.29/libusb/io.c:2501:13: call_function: calling 'get_next_timeout' from 'libusb_handle_events_locked'
#   56|   static inline int usbi_timer_valid(usbi_timer_t *timer)
#   57|   {
#   58|-> 	return timer->timerfd >= 0;
#   59|   }
#   60|   #endif

Error: GCC_ANALYZER_WARNING (CWE-775): [#def52]
libusb-1.0.29/libusb/os/linux_usbfs.c:191:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'get_usbfs_fd(*handle.dev, 2, 0)'
libusb-1.0.29/libusb/os/linux_usbfs.c:1410:12: enter_function: entry to 'op_open'
libusb-1.0.29/libusb/os/linux_usbfs.c:1414:14: call_function: calling 'get_usbfs_fd' from 'op_open'
libusb-1.0.29/libusb/os/linux_usbfs.c:1414:14: return_function: returning to 'op_open' from 'get_usbfs_fd'
libusb-1.0.29/libusb/os/linux_usbfs.c:1415:12: branch_true: following 'true' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:1416:20: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:1416:20: branch_true: following 'true' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:1419:25: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:1419:25: call_function: calling 'usbi_mutex_static_lock' from 'op_open'
libusb-1.0.29/libusb/os/linux_usbfs.c:1419:25: return_function: returning to 'op_open' from 'usbi_mutex_static_lock'
libusb-1.0.29/libusb/os/linux_usbfs.c:1420:28: branch_true: following 'true' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:1421:33: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:1421:33: throw: if 'usbi_log' throws an exception...
libusb-1.0.29/libusb/os/linux_usbfs.c:191:13: danger: 'get_usbfs_fd(*handle.dev, 2, 0)' leaks here; was opened at [(4)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/3)
#  189|   	int fd;
#  190|   
#  191|-> 	if (usbdev_names)
#  192|   		snprintf(path, sizeof(path), USBDEV_PATH "/usbdev%u.%u",
#  193|   			dev->bus_number, dev->device_address);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def53]
libusb-1.0.29/libusb/os/linux_usbfs.c:520:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open_sysfs_attr(ctx,  sysfs_dir,  attr)'
libusb-1.0.29/libusb/os/linux_usbfs.c:1448:12: enter_function: entry to 'op_get_configuration'
libusb-1.0.29/libusb/os/linux_usbfs.c:1455:12: branch_true: following 'true' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:1456:21: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:1456:21: call_function: calling 'sysfs_get_active_config' from 'op_get_configuration'
#  518|   		return LIBUSB_ERROR_IO;
#  519|   	}
#  520|-> 	close(fd);
#  521|   
#  522|   	if (r == 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def54]
libusb-1.0.29/libusb/os/linux_usbfs.c:2092:1: warning[-Wanalyzer-malloc-leak]: leak of 'urbs'
libusb-1.0.29/libusb/os/linux_usbfs.c:1988:16: acquire_memory: allocated here
libusb-1.0.29/libusb/os/linux_usbfs.c:1989:12: branch_false: following 'false' branch (when 'urbs' is non-NULL)...
libusb-1.0.29/libusb/os/linux_usbfs.c:1991:9: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:1997:21: branch_false: following 'false' branch (when 'num_urbs <= i')...
libusb-1.0.29/libusb/os/linux_usbfs.c:1997:21: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2092:1: danger: 'urbs' leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
# 2090|   
# 2091|   	return 0;
# 2092|-> }
# 2093|   
# 2094|   static int submit_iso_transfer(struct usbi_transfer *itransfer)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def55]
libusb-1.0.29/libusb/os/linux_usbfs.c:2195:25: warning[-Wanalyzer-malloc-leak]: leak of 'urb'
libusb-1.0.29/libusb/os/linux_usbfs.c:2110:12: branch_false: following 'false' branch (when 'num_packets > 0')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2110:12: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2118:21: branch_true: following 'true' branch (when 'i < num_packets')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2119:17: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2121:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2128:17: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2131:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2135:20: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2140:12: branch_false: following 'false' branch (when 'urbs' is non-NULL)...
libusb-1.0.29/libusb/os/linux_usbfs.c:2143:9: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2151:28: branch_true: following 'true' branch (when 'i < num_urbs')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2152:21: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2160:20: branch_false: following 'false' branch (when 'urb' is non-NULL)...
libusb-1.0.29/libusb/os/linux_usbfs.c:2164:21: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2167:29: branch_false: following 'false' branch (when 'k >= num_packets_in_urb')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2173:17: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2151:28: branch_true: following 'true' branch (when 'i < num_urbs')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2152:21: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2160:20: branch_false: following 'false' branch (when 'urb' is non-NULL)...
libusb-1.0.29/libusb/os/linux_usbfs.c:2164:21: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2167:29: branch_false: following 'false' branch (when 'k >= num_packets_in_urb')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2173:17: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2151:28: branch_true: following 'true' branch (when 'i < num_urbs')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2152:21: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2159:23: acquire_memory: allocated here
libusb-1.0.29/libusb/os/linux_usbfs.c:2160:20: branch_false: following 'false' branch (when 'urb' is non-NULL)...
libusb-1.0.29/libusb/os/linux_usbfs.c:2164:21: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2167:29: branch_false: following 'false' branch (when 'k >= num_packets_in_urb')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2173:17: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2151:28: branch_false: following 'false' branch (when 'i >= num_urbs')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2151:28: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2186:21: branch_true: following 'true' branch (when 'i < num_urbs')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2187:69: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2189:20: branch_false: following 'false' branch (when 'r != 0')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2192:21: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2192:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2194:27: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2194:27: branch_true: following 'true' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2195:25: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2195:25: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2195:25: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2195:25: throw: if 'usbi_log' throws an exception...
libusb-1.0.29/libusb/os/linux_usbfs.c:2195:25: danger: 'urb' leaks here; was allocated at [(25)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/24)
# 2193|   			r = LIBUSB_ERROR_NO_DEVICE;
# 2194|   		} else if (errno == EINVAL) {
# 2195|-> 			usbi_warn(TRANSFER_CTX(transfer), "submiturb failed, transfer too large");
# 2196|   			r = LIBUSB_ERROR_INVALID_PARAM;
# 2197|   		} else if (errno == EMSGSIZE) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def56]
libusb-1.0.29/libusb/os/linux_usbfs.c:2195:25: warning[-Wanalyzer-malloc-leak]: leak of 'urbs'
libusb-1.0.29/libusb/os/linux_usbfs.c:2110:12: branch_false: following 'false' branch (when 'num_packets > 0')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2110:12: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2118:21: branch_true: following 'true' branch (when 'i < num_packets')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2119:17: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2121:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2128:17: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2131:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2135:20: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2139:16: acquire_memory: allocated here
libusb-1.0.29/libusb/os/linux_usbfs.c:2140:12: branch_false: following 'false' branch (when 'urbs' is non-NULL)...
libusb-1.0.29/libusb/os/linux_usbfs.c:2143:9: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2151:28: branch_true: following 'true' branch (when 'i < num_urbs')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2152:21: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2160:20: branch_false: following 'false' branch (when 'urb' is non-NULL)...
libusb-1.0.29/libusb/os/linux_usbfs.c:2164:21: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2167:29: branch_false: following 'false' branch (when 'k >= num_packets_in_urb')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2173:17: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2186:21: branch_true: following 'true' branch (when 'i < num_urbs')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2187:69: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2189:20: branch_false: following 'false' branch (when 'r != 0')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2192:21: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2192:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2194:27: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2194:27: branch_true: following 'true' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2195:25: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2195:25: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2195:25: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2195:25: throw: if 'usbi_log' throws an exception...
libusb-1.0.29/libusb/os/linux_usbfs.c:2195:25: danger: 'urbs' leaks here; was allocated at [(9)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/8)
# 2193|   			r = LIBUSB_ERROR_NO_DEVICE;
# 2194|   		} else if (errno == EINVAL) {
# 2195|-> 			usbi_warn(TRANSFER_CTX(transfer), "submiturb failed, transfer too large");
# 2196|   			r = LIBUSB_ERROR_INVALID_PARAM;
# 2197|   		} else if (errno == EMSGSIZE) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def57]
libusb-1.0.29/libusb/os/linux_usbfs.c:2198:25: warning[-Wanalyzer-malloc-leak]: leak of 'urb'
libusb-1.0.29/libusb/os/linux_usbfs.c:2110:12: branch_false: following 'false' branch (when 'num_packets > 0')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2110:12: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2118:21: branch_true: following 'true' branch (when 'i < num_packets')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2119:17: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2121:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2128:17: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2131:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2135:20: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2140:12: branch_false: following 'false' branch (when 'urbs' is non-NULL)...
libusb-1.0.29/libusb/os/linux_usbfs.c:2143:9: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2151:28: branch_true: following 'true' branch (when 'i < num_urbs')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2152:21: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2160:20: branch_false: following 'false' branch (when 'urb' is non-NULL)...
libusb-1.0.29/libusb/os/linux_usbfs.c:2164:21: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2167:29: branch_false: following 'false' branch (when 'k >= num_packets_in_urb')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2173:17: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2151:28: branch_true: following 'true' branch (when 'i < num_urbs')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2152:21: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2160:20: branch_false: following 'false' branch (when 'urb' is non-NULL)...
libusb-1.0.29/libusb/os/linux_usbfs.c:2164:21: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2167:29: branch_false: following 'false' branch (when 'k >= num_packets_in_urb')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2173:17: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2151:28: branch_true: following 'true' branch (when 'i < num_urbs')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2152:21: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2159:23: acquire_memory: allocated here
libusb-1.0.29/libusb/os/linux_usbfs.c:2160:20: branch_false: following 'false' branch (when 'urb' is non-NULL)...
libusb-1.0.29/libusb/os/linux_usbfs.c:2164:21: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2167:29: branch_false: following 'false' branch (when 'k >= num_packets_in_urb')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2173:17: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2151:28: branch_false: following 'false' branch (when 'i >= num_urbs')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2151:28: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2186:21: branch_true: following 'true' branch (when 'i < num_urbs')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2187:69: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2189:20: branch_false: following 'false' branch (when 'r != 0')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2192:21: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2192:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2194:27: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2194:27: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2197:27: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2197:27: branch_true: following 'true' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2198:25: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2198:25: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2198:25: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2198:25: throw: if 'usbi_log' throws an exception...
libusb-1.0.29/libusb/os/linux_usbfs.c:2198:25: danger: 'urb' leaks here; was allocated at [(25)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/24)
# 2196|   			r = LIBUSB_ERROR_INVALID_PARAM;
# 2197|   		} else if (errno == EMSGSIZE) {
# 2198|-> 			usbi_warn(TRANSFER_CTX(transfer), "submiturb failed, iso packet length too large");
# 2199|   			r = LIBUSB_ERROR_INVALID_PARAM;
# 2200|   		} else {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def58]
libusb-1.0.29/libusb/os/linux_usbfs.c:2198:25: warning[-Wanalyzer-malloc-leak]: leak of 'urbs'
libusb-1.0.29/libusb/os/linux_usbfs.c:2110:12: branch_false: following 'false' branch (when 'num_packets > 0')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2110:12: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2118:21: branch_true: following 'true' branch (when 'i < num_packets')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2119:17: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2121:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2128:17: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2131:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2135:20: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2139:16: acquire_memory: allocated here
libusb-1.0.29/libusb/os/linux_usbfs.c:2140:12: branch_false: following 'false' branch (when 'urbs' is non-NULL)...
libusb-1.0.29/libusb/os/linux_usbfs.c:2143:9: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2151:28: branch_true: following 'true' branch (when 'i < num_urbs')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2152:21: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2160:20: branch_false: following 'false' branch (when 'urb' is non-NULL)...
libusb-1.0.29/libusb/os/linux_usbfs.c:2164:21: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2167:29: branch_false: following 'false' branch (when 'k >= num_packets_in_urb')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2173:17: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2186:21: branch_true: following 'true' branch (when 'i < num_urbs')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2187:69: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2189:20: branch_false: following 'false' branch (when 'r != 0')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2192:21: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2192:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2194:27: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2194:27: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2197:27: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2197:27: branch_true: following 'true' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2198:25: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2198:25: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2198:25: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2198:25: throw: if 'usbi_log' throws an exception...
libusb-1.0.29/libusb/os/linux_usbfs.c:2198:25: danger: 'urbs' leaks here; was allocated at [(9)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/8)
# 2196|   			r = LIBUSB_ERROR_INVALID_PARAM;
# 2197|   		} else if (errno == EMSGSIZE) {
# 2198|-> 			usbi_warn(TRANSFER_CTX(transfer), "submiturb failed, iso packet length too large");
# 2199|   			r = LIBUSB_ERROR_INVALID_PARAM;
# 2200|   		} else {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def59]
libusb-1.0.29/libusb/os/linux_usbfs.c:2201:25: warning[-Wanalyzer-malloc-leak]: leak of 'urb'
libusb-1.0.29/libusb/os/linux_usbfs.c:2110:12: branch_false: following 'false' branch (when 'num_packets > 0')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2110:12: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2118:21: branch_true: following 'true' branch (when 'i < num_packets')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2119:17: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2121:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2128:17: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2131:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2135:20: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2140:12: branch_false: following 'false' branch (when 'urbs' is non-NULL)...
libusb-1.0.29/libusb/os/linux_usbfs.c:2143:9: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2151:28: branch_true: following 'true' branch (when 'i < num_urbs')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2152:21: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2160:20: branch_false: following 'false' branch (when 'urb' is non-NULL)...
libusb-1.0.29/libusb/os/linux_usbfs.c:2164:21: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2167:29: branch_false: following 'false' branch (when 'k >= num_packets_in_urb')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2173:17: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2151:28: branch_true: following 'true' branch (when 'i < num_urbs')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2152:21: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2160:20: branch_false: following 'false' branch (when 'urb' is non-NULL)...
libusb-1.0.29/libusb/os/linux_usbfs.c:2164:21: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2167:29: branch_false: following 'false' branch (when 'k >= num_packets_in_urb')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2173:17: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2151:28: branch_true: following 'true' branch (when 'i < num_urbs')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2152:21: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2159:23: acquire_memory: allocated here
libusb-1.0.29/libusb/os/linux_usbfs.c:2160:20: branch_false: following 'false' branch (when 'urb' is non-NULL)...
libusb-1.0.29/libusb/os/linux_usbfs.c:2164:21: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2167:29: branch_false: following 'false' branch (when 'k >= num_packets_in_urb')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2173:17: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2151:28: branch_false: following 'false' branch (when 'i >= num_urbs')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2151:28: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2186:21: branch_true: following 'true' branch (when 'i < num_urbs')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2187:69: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2189:20: branch_false: following 'false' branch (when 'r != 0')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2192:21: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2192:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2194:27: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2194:27: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2197:27: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2197:27: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2201:25: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2201:25: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2201:25: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2201:25: throw: if 'usbi_log' throws an exception...
libusb-1.0.29/libusb/os/linux_usbfs.c:2201:25: danger: 'urb' leaks here; was allocated at [(25)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/24)
# 2199|   			r = LIBUSB_ERROR_INVALID_PARAM;
# 2200|   		} else {
# 2201|-> 			usbi_err(TRANSFER_CTX(transfer), "submiturb failed, errno=%d", errno);
# 2202|   			r = LIBUSB_ERROR_IO;
# 2203|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def60]
libusb-1.0.29/libusb/os/linux_usbfs.c:2201:25: warning[-Wanalyzer-malloc-leak]: leak of 'urbs'
libusb-1.0.29/libusb/os/linux_usbfs.c:2110:12: branch_false: following 'false' branch (when 'num_packets > 0')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2110:12: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2118:21: branch_true: following 'true' branch (when 'i < num_packets')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2119:17: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2121:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2128:17: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2131:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2135:20: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2139:16: acquire_memory: allocated here
libusb-1.0.29/libusb/os/linux_usbfs.c:2140:12: branch_false: following 'false' branch (when 'urbs' is non-NULL)...
libusb-1.0.29/libusb/os/linux_usbfs.c:2143:9: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2151:28: branch_true: following 'true' branch (when 'i < num_urbs')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2152:21: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2160:20: branch_false: following 'false' branch (when 'urb' is non-NULL)...
libusb-1.0.29/libusb/os/linux_usbfs.c:2164:21: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2167:29: branch_false: following 'false' branch (when 'k >= num_packets_in_urb')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2173:17: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2186:21: branch_true: following 'true' branch (when 'i < num_urbs')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2187:69: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2189:20: branch_false: following 'false' branch (when 'r != 0')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2192:21: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2192:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2194:27: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2194:27: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2197:27: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2197:27: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2201:25: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2201:25: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2201:25: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2201:25: throw: if 'usbi_log' throws an exception...
libusb-1.0.29/libusb/os/linux_usbfs.c:2201:25: danger: 'urbs' leaks here; was allocated at [(9)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/8)
# 2199|   			r = LIBUSB_ERROR_INVALID_PARAM;
# 2200|   		} else {
# 2201|-> 			usbi_err(TRANSFER_CTX(transfer), "submiturb failed, errno=%d", errno);
# 2202|   			r = LIBUSB_ERROR_IO;
# 2203|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def61]
libusb-1.0.29/libusb/os/linux_usbfs.c:2208:25: warning[-Wanalyzer-malloc-leak]: leak of 'urbs'
libusb-1.0.29/libusb/os/linux_usbfs.c:2110:12: branch_false: following 'false' branch (when 'num_packets > 0')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2110:12: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2118:21: branch_true: following 'true' branch (when 'i < num_packets')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2119:17: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2121:20: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2128:17: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2131:12: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2135:20: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2139:16: acquire_memory: allocated here
libusb-1.0.29/libusb/os/linux_usbfs.c:2140:12: branch_false: following 'false' branch (when 'urbs' is non-NULL)...
libusb-1.0.29/libusb/os/linux_usbfs.c:2143:9: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2151:28: branch_true: following 'true' branch (when 'i < num_urbs')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2152:21: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2160:20: branch_false: following 'false' branch (when 'urb' is non-NULL)...
libusb-1.0.29/libusb/os/linux_usbfs.c:2164:21: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2167:29: branch_false: following 'false' branch (when 'k >= num_packets_in_urb')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2173:17: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2186:21: branch_true: following 'true' branch (when 'i < num_urbs')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2187:69: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2189:20: branch_false: following 'false' branch (when 'r != 0')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2192:21: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2192:20: branch_true: following 'true' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2207:20: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2207:20: branch_true: following 'true' branch (when 'i == 0')...
libusb-1.0.29/libusb/os/linux_usbfs.c:2208:25: branch_true: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2208:25: branch_false: following 'false' branch...
libusb-1.0.29/libusb/os/linux_usbfs.c:2208:25: branch_false: ...to here
libusb-1.0.29/libusb/os/linux_usbfs.c:2208:25: throw: if 'usbi_log' throws an exception...
libusb-1.0.29/libusb/os/linux_usbfs.c:2208:25: danger: 'urbs' leaks here; was allocated at [(9)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/8)
# 2206|   		 * return failure immediately. */
# 2207|   		if (i == 0) {
# 2208|-> 			usbi_dbg(TRANSFER_CTX(transfer), "first URB failed, easy peasy");
# 2209|   			free_iso_urbs(tpriv);
# 2210|   			return r;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def62]
libusb-1.0.29/tests/umockdev.c:54:1: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘<unknown>’
libusb-1.0.29/tests/umockdev.c:188:9: branch_true: following ‘true’ branch...
libusb-1.0.29/tests/umockdev.c:188:9: branch_true: ...to here
libusb-1.0.29/tests/umockdev.c:190:16: branch_true: following ‘true’ branch...
libusb-1.0.29/tests/umockdev.c:194:23: branch_true: ...to here
libusb-1.0.29/tests/umockdev.c:195:39: throw: if ‘g_list_delete_link’ throws an exception...
libusb-1.0.29/tests/umockdev.c:191:39: call_function: inlined call to ‘glib_autoptr_cleanup_LogMessage’ from ‘assert_libusb_no_log_msg’
#   52|   	g_free(msg);
#   53|   }
#   54|-> G_DEFINE_AUTOPTR_CLEANUP_FUNC(LogMessage, log_message_free)
#   55|   
#   56|   typedef struct _UsbChat UsbChat;

Error: CPPCHECK_WARNING (CWE-562): [#def63]
libusb-1.0.29/tests/umockdev.c:603: error[autoVariables]: Address of local auto-variable assigned to a function parameter.
#  601|   	struct libusb_transfer *transfer = NULL;
#  602|   
#  603|-> 	fixture->chat = chat;
#  604|   
#  605|   	/* Open */

Error: CPPCHECK_WARNING (CWE-562): [#def64]
libusb-1.0.29/tests/umockdev.c:650: error[autoVariables]: Address of local auto-variable assigned to a function parameter.
#  648|   	struct libusb_transfer *transfer = NULL;
#  649|   
#  650|-> 	fixture->chat = chat;
#  651|   
#  652|   	/* Open */

Error: CPPCHECK_WARNING (CWE-562): [#def65]
libusb-1.0.29/tests/umockdev.c:696: error[autoVariables]: Address of local auto-variable assigned to a function parameter.
#  694|   	struct libusb_transfer *transfer = NULL;
#  695|   
#  696|-> 	fixture->chat = chat;
#  697|   
#  698|   	/* Open */

Error: CPPCHECK_WARNING (CWE-562): [#def66]
libusb-1.0.29/tests/umockdev.c:778: error[autoVariables]: Address of local auto-variable assigned to a function parameter.
#  776|   	};
#  777|   
#  778|-> 	fixture->chat = chat;
#  779|   
#  780|   	handle = libusb_open_device_with_vid_pid(fixture->ctx, 0x04a9, 0x31c0);

Error: CPPCHECK_WARNING (CWE-562): [#def67]
libusb-1.0.29/tests/umockdev.c:825: error[autoVariables]: Address of local auto-variable assigned to a function parameter.
#  823|   	struct libusb_transfer *transfer = NULL;
#  824|   
#  825|-> 	fixture->chat = chat;
#  826|   
#  827|   	handle = libusb_open_device_with_vid_pid(fixture->ctx, 0x04a9, 0x31c0);

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
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-56.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-namelibusb1-1.0.29-4.fc44
store-results-to/tmp/tmp58m9jz1x/libusb1-1.0.29-4.fc44.tar.xz
time-created2026-01-08 19:22:02
time-finished2026-01-08 19:23:58
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmp58m9jz1x/libusb1-1.0.29-4.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp58m9jz1x/libusb1-1.0.29-4.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9