bluez-5.76-1.fc41

List of Defects

Error: CPPCHECK_WARNING: [#def1]
bluez-5.76-build/bluez-5.76/attrib/att.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def2]
bluez-5.76-build/bluez-5.76/attrib/gatt.c:970:2: warning[unix.Malloc]: Potential leak of memory pointed to by 'long_write'
#  968|   	long_write->vlen = vlen;
#  969|   
#  970|-> 	return prepare_write(long_write);
#  971|   }
#  972|   

Error: CPPCHECK_WARNING: [#def3]
bluez-5.76-build/bluez-5.76/attrib/gattrib.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-457): [#def4]
bluez-5.76-build/bluez-5.76/attrib/gattrib.c: scope_hint: In function ‘construct_full_pdu’
bluez-5.76-build/bluez-5.76/attrib/gattrib.c:207:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘pdu’
#  205|   
#  206|   	if (pdu && length)
#  207|-> 		memcpy(buf + 1, pdu, length);
#  208|   
#  209|   	return buf;

Error: CPPCHECK_WARNING: [#def5]
bluez-5.76-build/bluez-5.76/attrib/gatttool.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def6]
bluez-5.76-build/bluez-5.76/attrib/interactive.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def7]
bluez-5.76-build/bluez-5.76/btio/btio.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-775): [#def8]
bluez-5.76-build/bluez-5.76/btio/btio.c: scope_hint: In function ‘server_cb.part.0’
bluez-5.76-build/bluez-5.76/btio/btio.c:256:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘g_io_channel_unix_get_fd(io)’
#  254|   
#  255|   	cli_sock = accept(srv_sock, NULL, NULL);
#  256|-> 	if (cli_sock < 0)
#  257|   		return TRUE;
#  258|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def9]
bluez-5.76-build/bluez-5.76/btio/btio.c: scope_hint: In function ‘sco_connect’
bluez-5.76-build/bluez-5.76/btio/btio.c:2043:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘g_io_channel_unix_get_fd(create_io(0, &opts,  gerr))’
bluez-5.76-build/bluez-5.76/btio/btio.c:21: included_from: Included from here.
# 2041|   	}
# 2042|   
# 2043|-> 	switch (opts.type) {
# 2044|   	case BT_IO_L2CAP:
# 2045|   		err = l2cap_connect(sock, &opts.dst, opts.dst_type,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def10]
bluez-5.76-build/bluez-5.76/btio/btio.c: scope_hint: In function ‘bt_io_listen’
bluez-5.76-build/bluez-5.76/btio/btio.c:2108:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘g_io_channel_unix_get_fd(create_io(1, &opts,  err))’
# 2106|   		}
# 2107|   
# 2108|-> 	if (listen(sock, 5) < 0) {
# 2109|   		ERROR_FAILED(err, "listen", errno);
# 2110|   		g_io_channel_unref(io);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def11]
bluez-5.76-build/bluez-5.76/client/advertising.c: scope_hint: In function ‘ad_register’
bluez-5.76-build/bluez-5.76/client/advertising.c:525:14: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
bluez-5.76-build/bluez-5.76/gdbus/gdbus.h:19: included_from: Included from here.
bluez-5.76-build/bluez-5.76/client/advertising.c:22: included_from: Included from here.
bluez-5.76-build/bluez-5.76/client/advertising.c:523:19: note: in expansion of macro ‘g_strdup’
bluez-5.76-build/bluez-5.76/client/advertising.c: scope_hint: In function ‘ad_register’
/usr/include/string.h:462: included_from: Included from here.
bluez-5.76-build/bluez-5.76/client/advertising.c:20: included_from: Included from here.
/usr/include/strings.h:116:12: note: argument 1 of ‘strcasecmp’ must be non-null
#  523|   	ad.type = g_strdup(type);
#  524|   
#  525|-> 	if (!strcasecmp(ad.type, "Broadcast"))
#  526|   		ad.discoverable = false;
#  527|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def12]
bluez-5.76-build/bluez-5.76/client/display.c: scope_hint: In function ‘rl_printf’
bluez-5.76-build/bluez-5.76/client/display.c:53:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘saved_line’
#   51|   	if (save_input) {
#   52|   		rl_restore_prompt();
#   53|-> 		rl_replace_line(saved_line, 0);
#   54|   		rl_point = saved_point;
#   55|   		rl_forced_update_display();

Error: CPPCHECK_WARNING: [#def13]
bluez-5.76-build/bluez-5.76/client/gatt.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-457): [#def14]
bluez-5.76-build/bluez-5.76/client/gatt.c:709: warning[uninitvar]: Uninitialized variable: value
#  707|   	*val_len = i;
#  708|   
#  709|-> 	return util_memdup(value, i);
#  710|   }
#  711|   

Error: CPPCHECK_WARNING: [#def15]
bluez-5.76-build/bluez-5.76/client/main.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def16]
bluez-5.76-build/bluez-5.76/client/mgmt.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-401): [#def17]
bluez-5.76-build/bluez-5.76/client/mgmt.c: scope_hint: In function ‘parse_bytes’
bluez-5.76-build/bluez-5.76/client/mgmt.c:4640:16: warning[-Wanalyzer-malloc-leak]: leak of ‘adv_data’
# 4638|   	}
# 4639|   
# 4640|-> 	*bytes = malloc(*len);
# 4641|   	if (!*bytes) {
# 4642|   		error("Failed to allocate memory");

Error: GCC_ANALYZER_WARNING (CWE-457): [#def18]
bluez-5.76-build/bluez-5.76/client/mgmt.c: scope_hint: In function ‘cmd_add_adv’
bluez-5.76-build/bluez-5.76/client/mgmt.c:4819:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘adv_data’
# 4817|   
# 4818|   	if (adv_len)
# 4819|-> 		memcpy(cp->data + uuid_bytes, adv_data, adv_len);
# 4820|   
# 4821|   	if (scan_rsp_len)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def19]
bluez-5.76-build/bluez-5.76/client/mgmt.c: scope_hint: In function ‘cmd_add_ext_adv_data’
bluez-5.76-build/bluez-5.76/client/mgmt.c:5243:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘adv_data’
# 5241|   
# 5242|   	if (adv_len)
# 5243|-> 		memcpy(cp->data + uuid_bytes, adv_data, adv_len);
# 5244|   
# 5245|   	if (scan_rsp_len)

Error: GCC_ANALYZER_WARNING: [#def20]
bluez-5.76-build/bluez-5.76/client/player.c: scope_hint: In function ‘transport_send_seq.part.0’
bluez-5.76-build/bluez-5.76/client/player.c:4968:23: warning[-Wanalyzer-fd-use-without-check]: ‘read’ on possibly invalid file descriptor ‘fd’
bluez-5.76-build/bluez-5.76/client/player.c: scope_hint: In function ‘transport_send_seq.part.0’
bluez-5.76-build/bluez-5.76/client/player.c:20: included_from: Included from here.
bluez-5.76-build/bluez-5.76/client/player.c: scope_hint: In function ‘transport_send_seq.part.0’
# 4966|   		off_t offset;
# 4967|   
# 4968|-> 		ret = read(fd, buf, transport->mtu[1]);
# 4969|   		if (ret <= 0) {
# 4970|   			if (ret < 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def21]
bluez-5.76-build/bluez-5.76/client/player.c: scope_hint: In function ‘cmd_send_transport’
bluez-5.76-build/bluez-5.76/client/player.c:5110:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
bluez-5.76-build/bluez-5.76/client/player.c: scope_hint: In function ‘cmd_send_transport’
# 5108|   		if (!proxy) {
# 5109|   			bt_shell_printf("Transport %s not found\n", argv[i]);
# 5110|-> 			return bt_shell_noninteractive_quit(EXIT_FAILURE);
# 5111|   		}
# 5112|   

Error: CPPCHECK_WARNING: [#def22]
bluez-5.76-build/bluez-5.76/emulator/amp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-688): [#def23]
bluez-5.76-build/bluez-5.76/emulator/b1ee.c: scope_hint: In function ‘server_read_callback.part.0’
bluez-5.76-build/bluez-5.76/emulator/b1ee.c:153:25: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘server_pkt_data’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
#  151|   			ssize_t written;
#  152|   
#  153|-> 			memcpy(server_pkt_data + server_pkt_len,
#  154|   						ptr, server_pkt_expect);
#  155|   			ptr += server_pkt_expect;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def24]
bluez-5.76-build/bluez-5.76/emulator/b1ee.c:166:25: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘server_pkt_data’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
#  164|   			server_pkt_data = NULL;
#  165|   		} else {
#  166|-> 			memcpy(server_pkt_data + server_pkt_len, ptr, count);
#  167|   			server_pkt_len += count;
#  168|   			server_pkt_expect -= count;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def25]
bluez-5.76-build/bluez-5.76/emulator/b1ee.c: scope_hint: In function ‘main’
bluez-5.76-build/bluez-5.76/emulator/b1ee.c:267:28: warning[-Wanalyzer-malloc-leak]: leak of ‘server_port’
#  265|   		case 'p':
#  266|   			server_port = set_port(optarg);
#  267|-> 			if (server_port == NULL)
#  268|   				goto usage;
#  269|   

Error: CLANG_WARNING: [#def26]
bluez-5.76-build/bluez-5.76/emulator/b1ee.c:289:2: warning[deadcode.DeadStores]: Value stored to 'argc' is never read
#  287|   	}
#  288|   
#  289|-> 	argc = argc - optind;
#  290|   	argv = argv + optind;
#  291|   	optind = 0;

Error: GCC_ANALYZER_WARNING (CWE-910): [#def27]
bluez-5.76-build/bluez-5.76/emulator/b1ee.c:300:19: warning[-Wanalyzer-fd-use-after-close]: ‘write’ on closed file descriptor ‘sniffer_fd’
#  298|   				sniffer_port ? : DEFAULT_SNIFFER_PORT);
#  299|   
#  300|-> 	written = write(sniffer_fd, sniff_cmd, sizeof(sniff_cmd));
#  301|   	if (written < 0)
#  302|   		perror("Failed to enable sniffer");

Error: GCC_ANALYZER_WARNING: [#def28]
bluez-5.76-build/bluez-5.76/emulator/b1ee.c:300:19: warning[-Wanalyzer-fd-use-without-check]: ‘write’ on possibly invalid file descriptor ‘-1’
#  298|   				sniffer_port ? : DEFAULT_SNIFFER_PORT);
#  299|   
#  300|-> 	written = write(sniffer_fd, sniff_cmd, sizeof(sniff_cmd));
#  301|   	if (written < 0)
#  302|   		perror("Failed to enable sniffer");

Error: CLANG_WARNING: [#def29]
bluez-5.76-build/bluez-5.76/emulator/b1ee.c:322:2: warning[unix.Malloc]: Potential leak of memory pointed to by 'server_port'
#  320|   
#  321|   usage:
#  322|-> 	usage();
#  323|   done:
#  324|   	free(server_port);

Error: CLANG_WARNING: [#def30]
bluez-5.76-build/bluez-5.76/emulator/b1ee.c:322:2: warning[unix.Malloc]: Potential leak of memory pointed to by 'sniffer_port'
#  320|   
#  321|   usage:
#  322|-> 	usage();
#  323|   done:
#  324|   	free(server_port);

Error: CPPCHECK_WARNING: [#def31]
bluez-5.76-build/bluez-5.76/emulator/btdev.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-457): [#def32]
bluez-5.76-build/bluez-5.76/emulator/btdev.c: scope_hint: In function ‘le_meta_event’
bluez-5.76-build/bluez-5.76/emulator/btdev.c:3740:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘data’
bluez-5.76-build/bluez-5.76/emulator/btdev.c:31: included_from: Included from here.
bluez-5.76-build/bluez-5.76/src/shared/util.h:29:27: note: in definition of macro ‘cpu_to_le16’
# 3738|   
# 3739|   	if (len > 0)
# 3740|-> 		memcpy(pkt_data + 1, data, len);
# 3741|   
# 3742|   	send_event(btdev, BT_HCI_EVT_LE_META_EVENT, pkt_data, 1 + len);

Error: CPPCHECK_WARNING: [#def33]
bluez-5.76-build/bluez-5.76/emulator/bthost.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-126): [#def34]
bluez-5.76-build/bluez-5.76/emulator/bthost.c: scope_hint: In function ‘queue_command’
bluez-5.76-build/bluez-5.76/emulator/bthost.c:571:52: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
bluez-5.76-build/bluez-5.76/emulator/bthost.c:571:52: note: read of 8 bytes from after the end of ‘iov’
bluez-5.76-build/bluez-5.76/emulator/bthost.c:571:52: note: valid subscripts for ‘iov’ are ‘[0]’ to ‘[2]’
#                                              └──────────────────────────┘
#                                                           ^
#  569|   
#  570|   	for (i = 0; i < iovlen; i++) {
#  571|-> 		memcpy(cmd->data + cmd->len, iov[i].iov_base, iov[i].iov_len);
#  572|   		cmd->len += iov[i].iov_len;
#  573|   	}

Error: GCC_ANALYZER_WARNING (CWE-126): [#def35]
bluez-5.76-build/bluez-5.76/emulator/bthost.c:571:69: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
bluez-5.76-build/bluez-5.76/emulator/bthost.c:571:69: note: read of 8 bytes from after the end of ‘iov’
bluez-5.76-build/bluez-5.76/emulator/bthost.c:571:69: note: valid subscripts for ‘iov’ are ‘[0]’ to ‘[2]’
#                                              └──────────────────────────┘
#                                                           ^
#  569|   
#  570|   	for (i = 0; i < iovlen; i++) {
#  571|-> 		memcpy(cmd->data + cmd->len, iov[i].iov_base, iov[i].iov_len);
#  572|   		cmd->len += iov[i].iov_len;
#  573|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def36]
bluez-5.76-build/bluez-5.76/emulator/bthost.c: scope_hint: In function ‘bthost_set_cig_params’
bluez-5.76-build/bluez-5.76/emulator/bthost.c:3405:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cp’
# 3403|   	cp = malloc(sizeof(*cp) + sizeof(*cp->cis));
# 3404|   	memset(cp, 0, sizeof(*cp) + sizeof(*cp->cis));
# 3405|-> 	cp->cig_id = cig_id;
# 3406|   	put_le24(qos->ucast.in.interval ? qos->ucast.in.interval :
# 3407|   				qos->ucast.out.interval, cp->c_interval);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def37]
bluez-5.76-build/bluez-5.76/emulator/bthost.c: scope_hint: In function ‘bthost_create_cis’
bluez-5.76-build/bluez-5.76/emulator/bthost.c:3437:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cp’
# 3435|   	cp = malloc(sizeof(*cp) + sizeof(*cp->cis));
# 3436|   	memset(cp, 0, sizeof(*cp) + sizeof(*cp->cis));
# 3437|-> 	cp->num_cis = 0x01;
# 3438|   	cp->cis[0].cis_handle = cpu_to_le16(cis_handle);
# 3439|   	cp->cis[0].acl_handle = cpu_to_le16(acl_handle);

Error: CPPCHECK_WARNING: [#def38]
bluez-5.76-build/bluez-5.76/emulator/le.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def39]
bluez-5.76-build/bluez-5.76/emulator/main.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def40]
bluez-5.76-build/bluez-5.76/emulator/phy.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-688): [#def41]
bluez-5.76-build/bluez-5.76/emulator/serial.c: scope_hint: In function ‘serial_read_callback.part.0’
bluez-5.76-build/bluez-5.76/emulator/serial.c:129:25: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘*(struct serial *)user_data.pkt_data + (sizetype)*(struct serial *)user_data.pkt_len’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
#  127|   
#  128|   		if (count >= serial->pkt_expect) {
#  129|-> 			memcpy(serial->pkt_data + serial->pkt_len,
#  130|   						ptr, serial->pkt_expect);
#  131|   			ptr += serial->pkt_expect;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def42]
bluez-5.76-build/bluez-5.76/emulator/serial.c:140:25: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘*(struct serial *)user_data.pkt_data + (sizetype)*(struct serial *)user_data.pkt_len’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
#  138|   			serial->pkt_data = NULL;
#  139|   		} else {
#  140|-> 			memcpy(serial->pkt_data + serial->pkt_len, ptr, count);
#  141|   			serial->pkt_len += count;
#  142|   			serial->pkt_expect -= count;

Error: CPPCHECK_WARNING (CWE-457): [#def43]
bluez-5.76-build/bluez-5.76/emulator/serial.c:150: error[legacyUninitvar]: Uninitialized variable: type
#  148|   static void open_pty(struct serial *serial)
#  149|   {
#  150|-> 	enum btdev_type uninitialized_var(type);
#  151|   
#  152|   	serial->fd = posix_openpt(O_RDWR | O_NOCTTY);

Error: CLANG_WARNING: [#def44]
bluez-5.76-build/bluez-5.76/emulator/serial.c:150:2: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
#  148|   static void open_pty(struct serial *serial)
#  149|   {
#  150|-> 	enum btdev_type uninitialized_var(type);
#  151|   
#  152|   	serial->fd = posix_openpt(O_RDWR | O_NOCTTY);

Error: CLANG_WARNING: [#def45]
bluez-5.76-build/bluez-5.76/emulator/serial.c:150:36: warning[deadcode.DeadStores]: Value stored to 'type' during its initialization is never read
#  148|   static void open_pty(struct serial *serial)
#  149|   {
#  150|-> 	enum btdev_type uninitialized_var(type);
#  151|   
#  152|   	serial->fd = posix_openpt(O_RDWR | O_NOCTTY);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def46]
bluez-5.76-build/bluez-5.76/emulator/serial.c: scope_hint: In function ‘open_pty’
bluez-5.76-build/bluez-5.76/emulator/serial.c:191:25: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘type’
bluez-5.76-build/bluez-5.76/emulator/serial.c:35:30: note: in definition of macro ‘uninitialized_var’
bluez-5.76-build/bluez-5.76/emulator/serial.c:35:30: note: in definition of macro ‘uninitialized_var’
#  189|   	}
#  190|   
#  191|-> 	serial->btdev = btdev_create(type, serial->id);
#  192|   	if (!serial->btdev) {
#  193|   		close(serial->fd);

Error: CPPCHECK_WARNING (CWE-457): [#def47]
bluez-5.76-build/bluez-5.76/emulator/serial.c:213: error[legacyUninitvar]: Uninitialized variable: dev_type
#  211|   {
#  212|   	struct serial *serial;
#  213|-> 	enum btdev_type uninitialized_var(dev_type);
#  214|   
#  215|   	serial = malloc(sizeof(*serial));

Error: CLANG_WARNING: [#def48]
bluez-5.76-build/bluez-5.76/emulator/serial.c:213:2: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
#  211|   {
#  212|   	struct serial *serial;
#  213|-> 	enum btdev_type uninitialized_var(dev_type);
#  214|   
#  215|   	serial = malloc(sizeof(*serial));

Error: CLANG_WARNING: [#def49]
bluez-5.76-build/bluez-5.76/emulator/serial.c:213:36: warning[deadcode.DeadStores]: Value stored to 'dev_type' during its initialization is never read
#  211|   {
#  212|   	struct serial *serial;
#  213|-> 	enum btdev_type uninitialized_var(dev_type);
#  214|   
#  215|   	serial = malloc(sizeof(*serial));

Error: GCC_ANALYZER_WARNING (CWE-688): [#def50]
bluez-5.76-build/bluez-5.76/emulator/server.c: scope_hint: In function ‘client_read_callback.part.0’
bluez-5.76-build/bluez-5.76/emulator/server.c:152:25: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘*(struct client *)user_data.pkt_data + (sizetype)*(struct client *)user_data.pkt_len’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
#  150|   
#  151|   		if (count >= client->pkt_expect) {
#  152|-> 			memcpy(client->pkt_data + client->pkt_len,
#  153|   						ptr, client->pkt_expect);
#  154|   			ptr += client->pkt_expect;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def51]
bluez-5.76-build/bluez-5.76/emulator/server.c:163:25: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘*(struct client *)user_data.pkt_data + (sizetype)*(struct client *)user_data.pkt_len’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
#  161|   			client->pkt_data = NULL;
#  162|   		} else {
#  163|-> 			memcpy(client->pkt_data + client->pkt_len, ptr, count);
#  164|   			client->pkt_len += count;
#  165|   			client->pkt_expect -= count;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def52]
bluez-5.76-build/bluez-5.76/emulator/server.c: scope_hint: In function ‘accept_client’
bluez-5.76-build/bluez-5.76/emulator/server.c:182:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*(struct server *)user_data.fd’
#  180|   	if (getsockname(fd, (struct sockaddr *) &addr, &len) < 0) {
#  181|   		perror("Failed to get socket name");
#  182|-> 		return -1;
#  183|   	}
#  184|   

Error: CPPCHECK_WARNING (CWE-457): [#def53]
bluez-5.76-build/bluez-5.76/emulator/server.c:200: error[legacyUninitvar]: Uninitialized variable: type
#  198|   	struct server *server = user_data;
#  199|   	struct client *client;
#  200|-> 	enum btdev_type uninitialized_var(type);
#  201|   
#  202|   	if (events & (EPOLLERR | EPOLLHUP)) {

Error: CLANG_WARNING: [#def54]
bluez-5.76-build/bluez-5.76/emulator/server.c:200:2: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
#  198|   	struct server *server = user_data;
#  199|   	struct client *client;
#  200|-> 	enum btdev_type uninitialized_var(type);
#  201|   
#  202|   	if (events & (EPOLLERR | EPOLLHUP)) {

Error: CLANG_WARNING: [#def55]
bluez-5.76-build/bluez-5.76/emulator/server.c:200:36: warning[deadcode.DeadStores]: Value stored to 'type' during its initialization is never read
#  198|   	struct server *server = user_data;
#  199|   	struct client *client;
#  200|-> 	enum btdev_type uninitialized_var(type);
#  201|   
#  202|   	if (events & (EPOLLERR | EPOLLHUP)) {

Error: CPPCHECK_WARNING: [#def56]
bluez-5.76-build/bluez-5.76/emulator/smp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-457): [#def57]
bluez-5.76-build/bluez-5.76/emulator/smp.c:244: error[uninitvar]: Uninitialized variable: &check
#  242|   				r, io_cap, local_addr, remote_addr, check.e);
#  243|   
#  244|-> 	smp_send(conn, BT_L2CAP_SMP_DHKEY_CHECK, &check, sizeof(check));
#  245|   }
#  246|   

Error: CPPCHECK_WARNING: [#def58]
bluez-5.76-build/bluez-5.76/gdbus/client.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def59]
bluez-5.76-build/bluez-5.76/gdbus/object.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-688): [#def60]
bluez-5.76-build/bluez-5.76/gdbus/object.c: scope_hint: In function 'invalidate_parent_data'
bluez-5.76-build/bluez-5.76/gdbus/object.c:718:17: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
bluez-5.76-build/bluez-5.76/gdbus/object.c: scope_hint: In function 'invalidate_parent_data'
bluez-5.76-build/bluez-5.76/gdbus/object.c: scope_hint: In function 'invalidate_parent_data'
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
bluez-5.76-build/bluez-5.76/gdbus/object.c:19: included_from: Included from here.
bluez-5.76-build/bluez-5.76/gdbus/object.c:717:23: note: in expansion of macro 'g_strdup'
bluez-5.76-build/bluez-5.76/gdbus/object.c: scope_hint: In function 'invalidate_parent_data'
bluez-5.76-build/bluez-5.76/gdbus/object.c:16: included_from: Included from here.
/usr/include/string.h:273:14: note: argument 1 of 'strrchr' must be non-null
#  716|   
#  717|   	parent_path = g_strdup(child_path);
#  718|-> 	slash = strrchr(parent_path, '/');
#  719|   	if (slash == NULL)
#  720|   		goto done;

Error: CPPCHECK_WARNING: [#def61]
bluez-5.76-build/bluez-5.76/gdbus/polkit.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def62]
bluez-5.76-build/bluez-5.76/gdbus/watch.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def63]
bluez-5.76-build/bluez-5.76/gdbus/watch.c:226:3: warning[unix.Malloc]: Attempt to free released memory
#  224|   
#  225|   	for (l = data->callbacks; l != NULL; l = l->next)
#  226|-> 		g_free(l->data);
#  227|   
#  228|   	g_slist_free(data->callbacks);

Error: GCC_ANALYZER_WARNING (CWE-131): [#def64]
bluez-5.76-build/bluez-5.76/gobex/gobex-apparam.c: scope_hint: In function ‘tag_new’
bluez-5.76-build/bluez-5.76/gobex/gobex-apparam.c:43:15: warning[-Wanalyzer-allocation-size]: allocated buffer size is not a multiple of the pointee's size
#   41|   	struct apparam_tag *tag;
#   42|   
#   43|-> 	tag = g_malloc0(2 + len);
#   44|   	tag->id = id;
#   45|   	tag->len = len;

Error: CLANG_WARNING: [#def65]
bluez-5.76-build/bluez-5.76/gobex/gobex-header.c:67:2: warning[core.NonNullParamChecker]: Null pointer passed to 2nd parameter expecting 'nonnull'
#   65|   static guint8 *put_bytes(guint8 *to, const void *from, gsize count)
#   66|   {
#   67|-> 	memcpy(to, from, count);
#   68|   	return (to + count);
#   69|   }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def66]
bluez-5.76-build/bluez-5.76/gobex/gobex-header.c:67:9: warning[-Wanalyzer-null-argument]: use of NULL ‘utf16’ where non-null expected
bluez-5.76-build/bluez-5.76/gobex/gobex-header.c: scope_hint: In function ‘g_obex_header_encode’
bluez-5.76-build/bluez-5.76/gobex/gobex-header.c: scope_hint: In function ‘g_obex_header_encode’
/usr/include/glib-2.0/glib.h:89: included_from: Included from here.
bluez-5.76-build/bluez-5.76/gobex/gobex-header.h:13: included_from: Included from here.
bluez-5.76-build/bluez-5.76/gobex/gobex-header.c:16: included_from: Included from here.
/usr/include/glib-2.0/glib/gtestutils.h:60:62: note: in definition of macro ‘g_assert_cmpuint’
<built-in>: scope_hint: In function ‘g_obex_header_encode’
<built-in>: note: argument 2 of ‘__builtin_memcpy’ must be non-null
#   65|   static guint8 *put_bytes(guint8 *to, const void *from, gsize count)
#   66|   {
#   67|-> 	memcpy(to, from, count);
#   68|   	return (to + count);
#   69|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def67]
bluez-5.76-build/bluez-5.76/gobex/gobex-header.c: scope_hint: In function ‘g_obex_header_create_list’
bluez-5.76-build/bluez-5.76/gobex/gobex-header.c:534:34: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘hdr’
bluez-5.76-build/bluez-5.76/gobex/gobex-header.c:511:25: note: in expansion of macro ‘G_OBEX_HDR_ENC’
#  532|   
#  533|   		l = g_slist_append(l, hdr);
#  534|-> 		*total_len += hdr->hlen;
#  535|   		id = va_arg(args, int);
#  536|   	}

Error: CPPCHECK_WARNING: [#def68]
bluez-5.76-build/bluez-5.76/gobex/gobex-packet.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def69]
bluez-5.76-build/bluez-5.76/gobex/gobex-transfer.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def70]
bluez-5.76-build/bluez-5.76/gobex/gobex-transfer.c:423:7: warning[unix.Malloc]: Use of memory after it is freed
#  421|   	transfer_put_req_first(transfer, req, first_hdr_id, args);
#  422|   	va_end(args);
#  423|-> 	if (!g_slist_find(transfers, transfer))
#  424|   		return 0;
#  425|   

Error: CPPCHECK_WARNING: [#def71]
bluez-5.76-build/bluez-5.76/gobex/gobex.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def72]
bluez-5.76-build/bluez-5.76/lib/hci.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def73]
bluez-5.76-build/bluez-5.76/lib/hci.c:97:4: warning[deadcode.DeadStores]: Value stored to 'ptr' is never read
#   95|   	while (m->str) {
#   96|   		if ((unsigned int) m->val == val) {
#   97|-> 			ptr += sprintf(ptr, "%s", m->str);
#   98|   			break;
#   99|   		}

Error: CPPCHECK_WARNING: [#def74]
bluez-5.76-build/bluez-5.76/lib/sdp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def75]
bluez-5.76-build/bluez-5.76/lib/sdp.c: scope_hint: In function 'sdp_attr_add'
bluez-5.76-build/bluez-5.76/lib/sdp.c:582:19: warning[-Wanalyzer-null-dereference]: dereference of NULL 'd'
bluez-5.76-build/bluez-5.76/lib/sdp.c: scope_hint: In function 'sdp_attr_add'
#  580|   		return -1;
#  581|   
#  582|-> 	d->attrId = attr;
#  583|   	rec->attrlist = sdp_list_insert_sorted(rec->attrlist, d, sdp_attrid_comp_func);
#  584|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def76]
bluez-5.76-build/bluez-5.76/lib/sdp.c: scope_hint: In function 'sdp_connect_local'
bluez-5.76-build/bluez-5.76/lib/sdp.c:4661:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'socket(1, 524289, 0)'
# 4659|   	strcpy(sa.sun_path, SDP_UNIX_PATH);
# 4660|   
# 4661|-> 	return connect(session->sock, (struct sockaddr *) &sa, sizeof(sa));
# 4662|   }
# 4663|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def77]
bluez-5.76-build/bluez-5.76/lib/sdp.c: scope_hint: In function 'sdp_connect_l2cap'
bluez-5.76-build/bluez-5.76/lib/sdp.c:4709:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'socket(31, sockflags, 0)'
# 4707|   	if (bacmp(src, BDADDR_ANY)) {
# 4708|   		sa.l2_bdaddr = *src;
# 4709|-> 		if (bind(sk, (struct sockaddr *) &sa, sizeof(sa)) < 0)
# 4710|   			return -1;
# 4711|   	}

Error: GCC_ANALYZER_WARNING (CWE-666): [#def78]
bluez-5.76-build/bluez-5.76/lib/sdp.c:4727:27: warning[-Wanalyzer-fd-phase-mismatch]: 'connect' on file descriptor '*session.sock' in wrong phase
# 4725|   
# 4726|   	do {
# 4727|-> 		int ret = connect(sk, (struct sockaddr *) &sa, sizeof(sa));
# 4728|   		if (!ret)
# 4729|   			return 0;

Error: GCC_ANALYZER_WARNING (CWE-666): [#def79]
bluez-5.76-build/bluez-5.76/lib/sdp.c:4727:27: warning[-Wanalyzer-fd-phase-mismatch]: 'connect' on file descriptor 'socket(31, sockflags, 0)' in wrong phase
# 4725|   
# 4726|   	do {
# 4727|-> 		int ret = connect(sk, (struct sockaddr *) &sa, sizeof(sa));
# 4728|   		if (!ret)
# 4729|   			return 0;

Error: CPPCHECK_WARNING: [#def80]
bluez-5.76-build/bluez-5.76/lib/uuid.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def81]
bluez-5.76-build/bluez-5.76/mesh/agent.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def82]
bluez-5.76-build/bluez-5.76/mesh/appkey.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def83]
bluez-5.76-build/bluez-5.76/mesh/cfgmod-server.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def84]
bluez-5.76-build/bluez-5.76/mesh/crypto.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def85]
bluez-5.76-build/bluez-5.76/mesh/dbus.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def86]
bluez-5.76-build/bluez-5.76/mesh/friend.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def87]
bluez-5.76-build/bluez-5.76/mesh/keyring.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def88]
bluez-5.76-build/bluez-5.76/mesh/main.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def89]
bluez-5.76-build/bluez-5.76/mesh/main.c:161:3: warning[deadcode.DeadStores]: Value stored to 'optarg' is never read
#  159|   		*opts = index;
#  160|   
#  161|-> 		optarg += strlen("auto");
#  162|   		*index = MGMT_INDEX_NONE;
#  163|   		return true;

Error: CPPCHECK_WARNING: [#def90]
bluez-5.76-build/bluez-5.76/mesh/manager.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def91]
bluez-5.76-build/bluez-5.76/mesh/mesh-config-json.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def92]
bluez-5.76-build/bluez-5.76/mesh/mesh-io-generic.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def93]
bluez-5.76-build/bluez-5.76/mesh/mesh-io-mgmt.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def94]
bluez-5.76-build/bluez-5.76/mesh/mesh-io-unit.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-775): [#def95]
bluez-5.76-build/bluez-5.76/mesh/mesh-io-unit.c: scope_hint: In function ‘unit_init’
bluez-5.76-build/bluez-5.76/mesh/mesh-io-unit.c:238:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*(struct mesh_io_private *)<unknown>.fd’
bluez-5.76-build/bluez-5.76/ell/ell.h:1: included_from: Included from here.
bluez-5.76-build/bluez-5.76/mesh/mesh-io-unit.c:22: included_from: Included from here.
bluez-5.76-build/bluez-5.76/mesh/mesh-io-unit.c:224:15: note: in expansion of macro ‘l_new’
#  236|   						strlen(pvt->addr.sun_path);
#  237|   
#  238|-> 	if (bind(pvt->fd, (struct sockaddr *) &pvt->addr, size) < 0)
#  239|   		goto fail;
#  240|   

Error: CPPCHECK_WARNING: [#def96]
bluez-5.76-build/bluez-5.76/mesh/mesh-io.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def97]
bluez-5.76-build/bluez-5.76/mesh/mesh-mgmt.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def98]
bluez-5.76-build/bluez-5.76/mesh/mesh.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def99]
bluez-5.76-build/bluez-5.76/mesh/model.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def100]
bluez-5.76-build/bluez-5.76/mesh/net-keys.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def101]
bluez-5.76-build/bluez-5.76/mesh/net.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-126): [#def102]
bluez-5.76-build/bluez-5.76/mesh/net.c: scope_hint: In function ‘friend_packet_queue’
bluez-5.76-build/bluez-5.76/mesh/net.c:1349:25: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
bluez-5.76-build/bluez-5.76/ell/ell.h:1: included_from: Included from here.
bluez-5.76-build/bluez-5.76/mesh/net.c:19: included_from: Included from here.
bluez-5.76-build/bluez-5.76/mesh/net.c:1198:28: note: in expansion of macro ‘l_new’
bluez-5.76-build/bluez-5.76/mesh/net.c:26: included_from: Included from here.
bluez-5.76-build/bluez-5.76/mesh/net.c:1366:29: note: in expansion of macro ‘FRND_OPCODE’
bluez-5.76-build/bluez-5.76/mesh/net.c:1349:25: note: read of 9 bytes from after the end of ‘msg’
bluez-5.76-build/bluez-5.76/mesh/net.c:1349:25: note: valid subscripts for ‘msg’ are ‘[0]’ to ‘[3]’
#             └───────────────────────────────────────────────────────────┘
#                  ^         ^                         ^
# 1347|   
# 1348|   		for (i = 0; i <= seg_max; i++) {
# 1349|-> 			memcpy(frnd_msg->u.s12[i].data, data, 12);
# 1350|   			frnd_msg->u.s12[i].hdr = hdr;
# 1351|   			frnd_msg->u.s12[i].seq = seqAuth + i;

Error: CPPCHECK_WARNING (CWE-457): [#def103]
bluez-5.76-build/bluez-5.76/mesh/net.c:2214: error[uninitvar]: Uninitialized variable: msg
# 2212|   		mesh_net_transport_send(net, 0, 0, mesh_net_get_iv_index(net),
# 2213|   					rsp_ttl, 0, dst & 0x8000 ? 0 : dst,
# 2214|-> 					src, msg, n);
# 2215|   
# 2216|   	return true;

Error: CPPCHECK_WARNING: [#def104]
bluez-5.76-build/bluez-5.76/mesh/node.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-688): [#def105]
bluez-5.76-build/bluez-5.76/mesh/node.c: scope_hint: In function ‘check_req_node’
bluez-5.76-build/bluez-5.76/mesh/node.c:1549:33: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
bluez-5.76-build/bluez-5.76/ell/util.h:11: included_from: Included from here.
bluez-5.76-build/bluez-5.76/ell/ell.h:1: included_from: Included from here.
bluez-5.76-build/bluez-5.76/mesh/node.c:21: included_from: Included from here.
/usr/include/string.h:64:12: note: argument 1 of ‘memcmp’ must be non-null
# 1547|   	node_del_comp(node, 128);
# 1548|   
# 1549|-> 	if (len == node_len && !memcmp(node_comp, comp, len))
# 1550|   		return true;
# 1551|   

Error: CPPCHECK_WARNING (CWE-457): [#def106]
bluez-5.76-build/bluez-5.76/mesh/node.c:2152: error[uninitvar]: Uninitialized variable: data
# 2150|   
# 2151|   	if (!update) {
# 2152|-> 		l_put_be16(OP_NETKEY_ADD, data);
# 2153|   
# 2154|   		if (key.phase != KEY_REFRESH_PHASE_TWO)

Error: CPPCHECK_WARNING: [#def107]
bluez-5.76-build/bluez-5.76/mesh/pb-adv.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def108]
bluez-5.76-build/bluez-5.76/mesh/prov-acceptor.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-465): [#def109]
bluez-5.76-build/bluez-5.76/mesh/prov-acceptor.c: scope_hint: In function ‘acp_prov_rx’
bluez-5.76-build/bluez-5.76/mesh/prov-acceptor.c:685:12: warning[-Wanalyzer-deref-before-check]: check of ‘prov’ for NULL after already dereferencing it
bluez-5.76-build/bluez-5.76/ell/ell.h:2: included_from: Included from here.
bluez-5.76-build/bluez-5.76/mesh/prov-acceptor.c:15: included_from: Included from here.
bluez-5.76-build/bluez-5.76/ell/log.h:90:31: note: in expansion of macro ‘L_DEBUG_SYMBOL’
bluez-5.76-build/bluez-5.76/mesh/prov-acceptor.c:440:9: note: in expansion of macro ‘l_debug’
#  683|   	}
#  684|   
#  685|-> 	if (prov)
#  686|   		prov->previous = type;
#  687|   	return;

Error: CPPCHECK_WARNING: [#def110]
bluez-5.76-build/bluez-5.76/mesh/prov-initiator.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-465): [#def111]
bluez-5.76-build/bluez-5.76/mesh/prov-initiator.c: scope_hint: In function ‘int_prov_rx’
bluez-5.76-build/bluez-5.76/mesh/prov-initiator.c:832:12: warning[-Wanalyzer-deref-before-check]: check of ‘prov’ for NULL after already dereferencing it
bluez-5.76-build/bluez-5.76/ell/ell.h:2: included_from: Included from here.
bluez-5.76-build/bluez-5.76/mesh/prov-initiator.c:15: included_from: Included from here.
bluez-5.76-build/bluez-5.76/ell/log.h:90:31: note: in expansion of macro ‘L_DEBUG_SYMBOL’
bluez-5.76-build/bluez-5.76/mesh/prov-initiator.c:664:9: note: in expansion of macro ‘l_debug’
#  830|   	}
#  831|   
#  832|-> 	if (prov)
#  833|   		prov->previous = type;
#  834|   

Error: CPPCHECK_WARNING: [#def112]
bluez-5.76-build/bluez-5.76/mesh/prvbeac-server.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def113]
bluez-5.76-build/bluez-5.76/mesh/remprv-server.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def114]
bluez-5.76-build/bluez-5.76/mesh/rpl.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-457): [#def115]
bluez-5.76-build/bluez-5.76/mesh/rpl.c:277: error[legacyUninitvar]: Uninitialized variable: val
#  275|   
#  276|   			/* Delete all invalid iv_index trees */
#  277|-> 			if (del || (val != cur && val != old)) {
#  278|   				snprintf(path, PATH_MAX, "%s%s/%s",
#  279|   					node_path, rpl_dir, entry->d_name);

Error: CPPCHECK_WARNING: [#def116]
bluez-5.76-build/bluez-5.76/mesh/util.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def117]
bluez-5.76-build/bluez-5.76/monitor/analyze.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def118]
bluez-5.76-build/bluez-5.76/monitor/att.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def119]
bluez-5.76-build/bluez-5.76/monitor/avctp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def120]
bluez-5.76-build/bluez-5.76/monitor/avdtp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def121]
bluez-5.76-build/bluez-5.76/monitor/bnep.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-457): [#def122]
bluez-5.76-build/bluez-5.76/monitor/bnep.c: scope_hint: In function ‘get_macaddr’
bluez-5.76-build/bluez-5.76/monitor/bnep.c:62:66: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘addr[5]’
bluez-5.76-build/bluez-5.76/monitor/bnep.c:30: included_from: Included from here.
bluez-5.76-build/bluez-5.76/monitor/l2cap.h: scope_hint: In function ‘get_macaddr’
bluez-5.76-build/bluez-5.76/monitor/l2cap.h: scope_hint: In function ‘get_macaddr’
bluez-5.76-build/bluez-5.76/monitor/bnep.c:29: included_from: Included from here.
bluez-5.76-build/bluez-5.76/monitor/display.h:56:17: note: in expansion of macro ‘print_indent’
bluez-5.76-build/bluez-5.76/monitor/bnep.c:222:9: note: in expansion of macro ‘print_field’
bluez-5.76-build/bluez-5.76/monitor/l2cap.h: scope_hint: In function ‘get_macaddr’
bluez-5.76-build/bluez-5.76/monitor/l2cap.h: scope_hint: In function ‘get_macaddr’
bluez-5.76-build/bluez-5.76/monitor/l2cap.h: scope_hint: In function ‘get_macaddr’
bluez-5.76-build/bluez-5.76/monitor/bnep.c: scope_hint: In function ‘get_macaddr’
bluez-5.76-build/bluez-5.76/monitor/l2cap.h: scope_hint: In function ‘get_macaddr’
bluez-5.76-build/bluez-5.76/monitor/l2cap.h: scope_hint: In function ‘get_macaddr’
bluez-5.76-build/bluez-5.76/monitor/l2cap.h: scope_hint: In function ‘get_macaddr’
bluez-5.76-build/bluez-5.76/monitor/bnep.c: scope_hint: In function ‘get_macaddr’
#   60|   
#   61|   	sprintf(str, "%02x:%02x:%02x:%02x:%02x:%02x",
#   62|-> 		addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);
#   63|   
#   64|   	return true;

Error: CPPCHECK_WARNING: [#def123]
bluez-5.76-build/bluez-5.76/monitor/control.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def124]
bluez-5.76-build/bluez-5.76/monitor/display.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-775): [#def125]
bluez-5.76-build/bluez-5.76/monitor/display.c:107:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd[0]’
#  105|   
#  106|   	if (pager_pid > 0)
#  107|-> 		return;
#  108|   
#  109|   	pager = getenv("PAGER");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def126]
bluez-5.76-build/bluez-5.76/monitor/display.c:107:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd[1]’
#  105|   
#  106|   	if (pager_pid > 0)
#  107|-> 		return;
#  108|   
#  109|   	pager = getenv("PAGER");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def127]
bluez-5.76-build/bluez-5.76/monitor/display.c:158:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(fd[1], 1)’
#  156|   	}
#  157|   
#  158|-> 	if (dup2(fd[1], STDOUT_FILENO) < 0) {
#  159|   		perror("Failed to duplicate pager pipe");
#  160|   		return;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def128]
bluez-5.76-build/bluez-5.76/monitor/display.c:164:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd[0]’
#  162|   
#  163|   	close_pipe(fd);
#  164|-> }
#  165|   
#  166|   void close_pager(void)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def129]
bluez-5.76-build/bluez-5.76/monitor/display.c: scope_hint: In function ‘open_pager’
bluez-5.76-build/bluez-5.76/monitor/display.c:164:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd[1]’
#  162|   
#  163|   	close_pipe(fd);
#  164|-> }
#  165|   
#  166|   void close_pager(void)

Error: CPPCHECK_WARNING: [#def130]
bluez-5.76-build/bluez-5.76/monitor/hcidump.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def131]
bluez-5.76-build/bluez-5.76/monitor/hwdb.c:59:2: warning[deadcode.DeadStores]: Value stored to 'hwdb' is never read
#   57|   	}
#   58|   
#   59|-> 	hwdb = udev_hwdb_unref(hwdb);
#   60|   
#   61|   	result = true;

Error: CLANG_WARNING: [#def132]
bluez-5.76-build/bluez-5.76/monitor/hwdb.c:64:2: warning[deadcode.DeadStores]: Value stored to 'udev' is never read
#   62|   
#   63|   done:
#   64|-> 	udev = udev_unref(udev);
#   65|   
#   66|   	return result;

Error: CLANG_WARNING: [#def133]
bluez-5.76-build/bluez-5.76/monitor/hwdb.c:106:2: warning[deadcode.DeadStores]: Value stored to 'hwdb' is never read
#  104|   	}
#  105|   
#  106|-> 	hwdb = udev_hwdb_unref(hwdb);
#  107|   
#  108|   	result = true;

Error: CLANG_WARNING: [#def134]
bluez-5.76-build/bluez-5.76/monitor/hwdb.c:111:2: warning[deadcode.DeadStores]: Value stored to 'udev' is never read
#  109|   
#  110|   done:
#  111|-> 	udev = udev_unref(udev);
#  112|   
#  113|   	return result;

Error: CPPCHECK_WARNING: [#def135]
bluez-5.76-build/bluez-5.76/monitor/jlink.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def136]
bluez-5.76-build/bluez-5.76/monitor/jlink.c: scope_hint: In function ‘jlink_start_rtt’
bluez-5.76-build/bluez-5.76/monitor/jlink.c:207:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘tok’
#  205|   
#  206|   	tok = strtok(cfg, ",");
#  207|-> 	if (strlen(tok)) {
#  208|   		address = strtol(tok, NULL, 0);
#  209|   		area_size = 0x1000;

Error: CPPCHECK_WARNING: [#def137]
bluez-5.76-build/bluez-5.76/monitor/l2cap.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def138]
bluez-5.76-build/bluez-5.76/monitor/ll.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def139]
bluez-5.76-build/bluez-5.76/monitor/main.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def140]
bluez-5.76-build/bluez-5.76/monitor/rfcomm.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def141]
bluez-5.76-build/bluez-5.76/monitor/sdp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def142]
bluez-5.76-build/bluez-5.76/obexd/client/bluetooth.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def143]
bluez-5.76-build/bluez-5.76/obexd/client/map.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def144]
bluez-5.76-build/bluez-5.76/obexd/client/pbap.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def145]
bluez-5.76-build/bluez-5.76/obexd/client/session.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def146]
bluez-5.76-build/bluez-5.76/obexd/client/transfer.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def147]
bluez-5.76-build/bluez-5.76/obexd/plugins/ftp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def148]
bluez-5.76-build/bluez-5.76/obexd/plugins/mas.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def149]
bluez-5.76-build/bluez-5.76/obexd/plugins/messages-dummy.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def150]
bluez-5.76-build/bluez-5.76/obexd/plugins/messages-dummy.c:163:9: warning[core.NullDereference]: Access to field 'next' results in a dereference of a null pointer (loaded from variable 'cur')
#  161|   
#  162|   	for (cur = list; offs < fld->offset; offs++) {
#  163|-> 		cur = cur->next;
#  164|   		if (cur == NULL)
#  165|   			break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def151]
bluez-5.76-build/bluez-5.76/obexd/plugins/messages-dummy.c: scope_hint: In function ‘return_folder_listing’
bluez-5.76-build/bluez-5.76/obexd/plugins/messages-dummy.c:163:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘cur’
bluez-5.76-build/bluez-5.76/obexd/plugins/messages-dummy.c:18: included_from: Included from here.
#  161|   
#  162|   	for (cur = list; offs < fld->offset; offs++) {
#  163|-> 		cur = cur->next;
#  164|   		if (cur == NULL)
#  165|   			break;

Error: CPPCHECK_WARNING: [#def152]
bluez-5.76-build/bluez-5.76/obexd/plugins/pbap.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def153]
bluez-5.76-build/bluez-5.76/obexd/plugins/pcsuite.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def154]
bluez-5.76-build/bluez-5.76/obexd/plugins/phonebook-dummy.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def155]
bluez-5.76-build/bluez-5.76/obexd/plugins/vcard.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def156]
bluez-5.76-build/bluez-5.76/obexd/plugins/vcard.c:701:6: warning[core.CallAndMessage]: 2nd function call argument is an uninitialized value
#  699|   		address_fields[i++] = l->data;
#  700|   
#  701|-> 	if (select_qp_encoding(format, address_fields[0], address_fields[1],
#  702|   					address_fields[2], address_fields[3],
#  703|   					address_fields[4], address_fields[5],

Error: CLANG_WARNING: [#def157]
bluez-5.76-build/bluez-5.76/obexd/plugins/vcard.c:701:6: warning[core.CallAndMessage]: 3rd function call argument is an uninitialized value
#  699|   		address_fields[i++] = l->data;
#  700|   
#  701|-> 	if (select_qp_encoding(format, address_fields[0], address_fields[1],
#  702|   					address_fields[2], address_fields[3],
#  703|   					address_fields[4], address_fields[5],

Error: CLANG_WARNING: [#def158]
bluez-5.76-build/bluez-5.76/obexd/plugins/vcard.c:701:6: warning[core.CallAndMessage]: 4th function call argument is an uninitialized value
#  699|   		address_fields[i++] = l->data;
#  700|   
#  701|-> 	if (select_qp_encoding(format, address_fields[0], address_fields[1],
#  702|   					address_fields[2], address_fields[3],
#  703|   					address_fields[4], address_fields[5],

Error: CLANG_WARNING: [#def159]
bluez-5.76-build/bluez-5.76/obexd/plugins/vcard.c:701:6: warning[core.CallAndMessage]: 5th function call argument is an uninitialized value
#  699|   		address_fields[i++] = l->data;
#  700|   
#  701|-> 	if (select_qp_encoding(format, address_fields[0], address_fields[1],
#  702|   					address_fields[2], address_fields[3],
#  703|   					address_fields[4], address_fields[5],

Error: CPPCHECK_WARNING: [#def160]
bluez-5.76-build/bluez-5.76/obexd/src/log.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-570): [#def161]
bluez-5.76-build/bluez-5.76/obexd/src/log.c:85: error[comparePointers]: Comparing pointers that point to different objects
#   83|   	struct obex_debug_desc *desc;
#   84|   
#   85|-> 	for (desc = __start___debug; desc < __stop___debug; desc++)
#   86|   		desc->flags |= OBEX_DEBUG_FLAG_PRINT;
#   87|   }

Error: CPPCHECK_WARNING (CWE-570): [#def162]
bluez-5.76-build/bluez-5.76/obexd/src/log.c:98: error[comparePointers]: Comparing pointers that point to different objects
#   96|   		enabled = g_strsplit_set(debug, ":, ", 0);
#   97|   
#   98|-> 	for (desc = __start___debug; desc < __stop___debug; desc++) {
#   99|   		if (file != NULL || name != NULL) {
#  100|   			if (g_strcmp0(desc->file, file) == 0) {

Error: CPPCHECK_WARNING: [#def163]
bluez-5.76-build/bluez-5.76/obexd/src/main.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def164]
bluez-5.76-build/bluez-5.76/obexd/src/main.c:278:6: warning[core.NullDereference]: Array access (from variable 'option_root') results in a null pointer dereference
#  276|   	}
#  277|   
#  278|-> 	if (option_root[0] != '/') {
#  279|   		const char *home = getenv("HOME");
#  280|   		if (home) {

Error: CPPCHECK_WARNING: [#def165]
bluez-5.76-build/bluez-5.76/obexd/src/manager.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def166]
bluez-5.76-build/bluez-5.76/obexd/src/mimetype.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def167]
bluez-5.76-build/bluez-5.76/obexd/src/obex.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def168]
bluez-5.76-build/bluez-5.76/obexd/src/obex.c:123:3: warning[core.NullDereference]: Access to field 'close' results in a dereference of a null pointer (loaded from field 'driver')
#  121|   	if (os->object) {
#  122|   		obex_object_reset_io_watch(os->object);
#  123|-> 		os->driver->close(os->object);
#  124|   		if (os->aborted && os->cmd == G_OBEX_OP_PUT && os->path &&
#  125|   				os->driver->remove)

Error: CPPCHECK_WARNING: [#def169]
bluez-5.76-build/bluez-5.76/obexd/src/plugin.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def170]
bluez-5.76-build/bluez-5.76/peripheral/attach.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def171]
bluez-5.76-build/bluez-5.76/peripheral/gap.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def172]
bluez-5.76-build/bluez-5.76/plugins/neard.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def173]
bluez-5.76-build/bluez-5.76/profiles/audio/a2dp.c: scope_hint: In function ‘a2dp_find_eps’
bluez-5.76-build/bluez-5.76/profiles/audio/a2dp.c:2852:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
# 2850|   
# 2851|   		/* Prepend last used so it is preferred over others */
# 2852|-> 		if (chan->last_used && (chan->last_used->lsep == sep &&
# 2853|   					chan->last_used->rsep->sep == rsep))
# 2854|   			queue_push_head(seps, sep);

Error: CPPCHECK_WARNING: [#def174]
bluez-5.76-build/bluez-5.76/profiles/audio/avctp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def175]
bluez-5.76-build/bluez-5.76/profiles/audio/avdtp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def176]
bluez-5.76-build/bluez-5.76/profiles/audio/avdtp.c:639:19: warning[core.NullDereference]: Access to field 'open_acp' results in a dereference of a null pointer (loaded from variable 'stream')
#  637|   static void stream_set_pending_open(struct avdtp_stream *stream, GIOChannel *io)
#  638|   {
#  639|-> 	stream->open_acp = TRUE;
#  640|   	stream->session->pending_open = stream;
#  641|   	stream->session->pending_open_io = io;

Error: CLANG_WARNING: [#def177]
bluez-5.76-build/bluez-5.76/profiles/audio/avdtp.c:895:25: warning[unix.Malloc]: Use of memory after it is freed
#  893|   		req = l->data;
#  894|   		pending_req_free(req);
#  895|-> 		session->prio_queue = g_slist_remove(session->prio_queue, req);
#  896|   	}
#  897|   

Error: CLANG_WARNING: [#def178]
bluez-5.76-build/bluez-5.76/profiles/audio/avdtp.c:902:24: warning[unix.Malloc]: Use of memory after it is freed
#  900|   		req = l->data;
#  901|   		pending_req_free(req);
#  902|-> 		session->req_queue = g_slist_remove(session->req_queue, req);
#  903|   	}
#  904|   }

Error: CLANG_WARNING: [#def179]
bluez-5.76-build/bluez-5.76/profiles/audio/avdtp.c:1716:29: warning[core.NullDereference]: Access to field 'rseid' results in a dereference of a null pointer (loaded from variable 'stream')
# 1714|   	case AVDTP_OPEN:
# 1715|   	case AVDTP_CLOSE:
# 1716|-> 		check_seid_collision(req, stream->rseid);
# 1717|   		break;
# 1718|   	case AVDTP_START:

Error: CPPCHECK_WARNING: [#def180]
bluez-5.76-build/bluez-5.76/profiles/audio/avrcp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-688): [#def181]
bluez-5.76-build/bluez-5.76/profiles/audio/avrcp.c: scope_hint: In function ‘play_status_to_val’
bluez-5.76-build/bluez-5.76/profiles/audio/avrcp.c:731:14: warning[-Wanalyzer-null-argument]: use of NULL ‘status’ where non-null expected
bluez-5.76-build/bluez-5.76/profiles/audio/avrcp.c: scope_hint: In function ‘play_status_to_val’
/usr/include/string.h:462: included_from: Included from here.
/usr/include/glib-2.0/glib/galloca.h:35: included_from: Included from here.
/usr/include/glib-2.0/glib.h:32: included_from: Included from here.
bluez-5.76-build/bluez-5.76/profiles/audio/avrcp.c:30: included_from: Included from here.
/usr/include/strings.h:116:12: note: argument 1 of ‘strcasecmp’ must be non-null
#  729|   static int play_status_to_val(const char *status)
#  730|   {
#  731|-> 	if (!strcasecmp(status, "stopped"))
#  732|   		return AVRCP_PLAY_STATUS_STOPPED;
#  733|   	else if (!strcasecmp(status, "playing"))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def182]
bluez-5.76-build/bluez-5.76/profiles/audio/avrcp.c: scope_hint: In function ‘avrcp_player_event.part.0’
bluez-5.76-build/bluez-5.76/profiles/audio/avrcp.c:814:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘data’
bluez-5.76-build/bluez-5.76/profiles/audio/avrcp.c: scope_hint: In function ‘avrcp_player_event.part.0’
#  812|   	case AVRCP_EVENT_TRACK_CHANGED:
#  813|   		size = 9;
#  814|-> 		memcpy(&pdu->params[1], data, sizeof(uint64_t));
#  815|   
#  816|   		break;

Error: CPPCHECK_WARNING (CWE-457): [#def183]
bluez-5.76-build/bluez-5.76/profiles/audio/avrcp.c:2343: warning[uninitvar]: Uninitialized variable: attrs
# 2341|   	pdu->params[0] = count;
# 2342|   
# 2343|-> 	memcpy(pdu->params + 1, attrs, count);
# 2344|   
# 2345|   	avctp_send_vendordep_req(session->conn, AVC_CTYPE_STATUS,

Error: CPPCHECK_WARNING: [#def184]
bluez-5.76-build/bluez-5.76/profiles/audio/bap.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def185]
bluez-5.76-build/bluez-5.76/profiles/audio/media.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def186]
bluez-5.76-build/bluez-5.76/profiles/audio/media.c:1046:7: warning[unix.Malloc]: Use of memory after it is freed
# 1044|   		struct pac_select_data *data;
# 1045|   
# 1046|-> 		if (req->cb != pac_select_cb) {
# 1047|   			l = g_slist_next(l);
# 1048|   			continue;

Error: CPPCHECK_WARNING: [#def187]
bluez-5.76-build/bluez-5.76/profiles/audio/player.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-688): [#def188]
bluez-5.76-build/bluez-5.76/profiles/audio/player.c: scope_hint: In function ‘media_player_set_setting’
bluez-5.76-build/bluez-5.76/profiles/audio/player.c:1359:13: warning[-Wanalyzer-null-argument]: use of NULL ‘value’ where non-null expected
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
bluez-5.76-build/bluez-5.76/profiles/audio/player.c:25: included_from: Included from here.
bluez-5.76-build/bluez-5.76/profiles/audio/player.c:1350:59: note: in expansion of macro ‘g_strdup’
bluez-5.76-build/bluez-5.76/profiles/audio/player.c: scope_hint: In function ‘media_player_set_setting’
bluez-5.76-build/bluez-5.76/profiles/audio/player.c:1350:44: note: in expansion of macro ‘g_strdup’
bluez-5.76-build/bluez-5.76/profiles/audio/player.c: scope_hint: In function ‘media_player_set_setting’
/usr/include/string.h:462: included_from: Included from here.
bluez-5.76-build/bluez-5.76/profiles/audio/player.c:23: included_from: Included from here.
/usr/include/strings.h:116:12: note: argument 1 of ‘strcasecmp’ must be non-null
# 1357|   		return;
# 1358|   
# 1359|-> 	if (strcasecmp(value, p->value) == 0)
# 1360|   		g_dbus_pending_property_success(p->id);
# 1361|   	else

Error: CPPCHECK_WARNING: [#def189]
bluez-5.76-build/bluez-5.76/profiles/audio/sink.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def190]
bluez-5.76-build/bluez-5.76/profiles/audio/source.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def191]
bluez-5.76-build/bluez-5.76/profiles/audio/transport.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def192]
bluez-5.76-build/bluez-5.76/profiles/cups/hcrp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-666): [#def193]
bluez-5.76-build/bluez-5.76/profiles/cups/hcrp.c: scope_hint: In function ‘hcrp_print’
bluez-5.76-build/bluez-5.76/profiles/cups/hcrp.c:213:13: warning[-Wanalyzer-fd-phase-mismatch]: ‘connect’ on file descriptor ‘ctrl_sk’ in wrong phase
#  211|   	addr.l2_psm = htobs(ctrl_psm);
#  212|   
#  213|-> 	if (connect(ctrl_sk, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
#  214|   		perror("ERROR: Can't connect to device");
#  215|   		close(ctrl_sk);

Error: CPPCHECK_WARNING: [#def194]
bluez-5.76-build/bluez-5.76/profiles/cups/main.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-457): [#def195]
bluez-5.76-build/bluez-5.76/profiles/cups/main.c: scope_hint: In function ‘main’
bluez-5.76-build/bluez-5.76/profiles/cups/main.c:768:56: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘b[5]’
#  766|   	}
#  767|   	sprintf(device, "%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X",
#  768|-> 			b[0], b[1], b[2], b[3], b[4], b[5]);
#  769|   
#  770|   	str2ba(device, &bdaddr);

Error: CPPCHECK_WARNING: [#def196]
bluez-5.76-build/bluez-5.76/profiles/cups/sdp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def197]
bluez-5.76-build/bluez-5.76/profiles/cups/spp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-666): [#def198]
bluez-5.76-build/bluez-5.76/profiles/cups/spp.c: scope_hint: In function ‘spp_print’
bluez-5.76-build/bluez-5.76/profiles/cups/spp.c:59:13: warning[-Wanalyzer-fd-phase-mismatch]: ‘connect’ on file descriptor ‘sk’ in wrong phase
#   57|   	addr.rc_channel = channel;
#   58|   
#   59|-> 	if (connect(sk, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
#   60|   		perror("ERROR: Can't connect to device");
#   61|   		close(sk);

Error: CPPCHECK_WARNING: [#def199]
bluez-5.76-build/bluez-5.76/profiles/gap/gas.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def200]
bluez-5.76-build/bluez-5.76/profiles/health/mcap.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def201]
bluez-5.76-build/bluez-5.76/profiles/input/device.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def202]
bluez-5.76-build/bluez-5.76/profiles/input/hog-lib.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def203]
bluez-5.76-build/bluez-5.76/profiles/input/manager.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def204]
bluez-5.76-build/bluez-5.76/profiles/input/server.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def205]
bluez-5.76-build/bluez-5.76/profiles/network/connection.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def206]
bluez-5.76-build/bluez-5.76/profiles/network/server.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def207]
bluez-5.76-build/bluez-5.76/src/adapter.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def208]
bluez-5.76-build/bluez-5.76/src/adv_monitor.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def209]
bluez-5.76-build/bluez-5.76/src/adv_monitor.c: scope_hint: In function ‘monitor_process’
bluez-5.76-build/bluez-5.76/src/adv_monitor.c:976:48: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*monitor.merged_pattern’
bluez-5.76-build/bluez-5.76/src/adv_monitor.c:36: included_from: Included from here.
bluez-5.76-build/bluez-5.76/src/adv_monitor.c:975:35: note: in expansion of macro ‘malloc0’
#  974|   
#  975|   	monitor->merged_pattern = malloc0(sizeof(*monitor->merged_pattern));
#  976|-> 	monitor->merged_pattern->current_state = MERGED_PATTERN_STATE_STABLE;
#  977|   	monitor->merged_pattern->next_state = MERGED_PATTERN_STATE_STABLE;
#  978|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def210]
bluez-5.76-build/bluez-5.76/src/adv_monitor.c:976:48: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘calloc(1, 56)’
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
bluez-5.76-build/bluez-5.76/src/adv_monitor.c:20: included_from: Included from here.
/usr/include/glib-2.0/glib/gstrfuncs.h:180:30: note: in definition of macro ‘g_str_has_prefix’
bluez-5.76-build/bluez-5.76/src/adv_monitor.c:695:19: note: in expansion of macro ‘new0’
bluez-5.76-build/bluez-5.76/src/adv_monitor.c:975:35: note: in expansion of macro ‘malloc0’
#  974|   
#  975|   	monitor->merged_pattern = malloc0(sizeof(*monitor->merged_pattern));
#  976|-> 	monitor->merged_pattern->current_state = MERGED_PATTERN_STATE_STABLE;
#  977|   	monitor->merged_pattern->next_state = MERGED_PATTERN_STATE_STABLE;
#  978|   

Error: CPPCHECK_WARNING: [#def211]
bluez-5.76-build/bluez-5.76/src/advertising.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def212]
bluez-5.76-build/bluez-5.76/src/battery.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def213]
bluez-5.76-build/bluez-5.76/src/battery.c:234:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘battery’
bluez-5.76-build/bluez-5.76/src/log.h:60:9: note: in expansion of macro ‘DBG_IDX’
bluez-5.76-build/bluez-5.76/src/battery.c:222:9: note: in expansion of macro ‘DBG’
#  232|   	}
#  233|   
#  234|-> 	if (battery->percentage == percentage)
#  235|   		return true;
#  236|   

Error: CPPCHECK_WARNING: [#def214]
bluez-5.76-build/bluez-5.76/src/device.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def215]
bluez-5.76-build/bluez-5.76/src/device.c: scope_hint: In function ‘device_bonding_retry’
bluez-5.76-build/bluez-5.76/src/device.c:6580:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘data’
bluez-5.76-build/bluez-5.76/src/device.c: scope_hint: In function ‘device_bonding_retry’
# 6578|   	struct btd_device *device = data;
# 6579|   	struct btd_adapter *adapter = device_get_adapter(device);
# 6580|-> 	struct bonding_req *bonding = device->bonding;
# 6581|   	uint8_t io_cap;
# 6582|   	int err;

Error: CPPCHECK_WARNING: [#def216]
bluez-5.76-build/bluez-5.76/src/eir.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def217]
bluez-5.76-build/bluez-5.76/src/gatt-client.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def218]
bluez-5.76-build/bluez-5.76/src/gatt-database.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-570): [#def219]
bluez-5.76-build/bluez-5.76/src/log.c:159: error[comparePointers]: Comparing pointers that point to different objects
#  157|   	struct btd_debug_desc *desc;
#  158|   
#  159|-> 	for (desc = __start___debug; desc < __stop___debug; desc++)
#  160|   		desc->flags |= BTD_DEBUG_FLAG_PRINT;
#  161|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def220]
bluez-5.76-build/bluez-5.76/src/battery.c:28: included_from: Included from here.
bluez-5.76-build/bluez-5.76/src/battery.c: scope_hint: In function ‘btd_battery_update’
bluez-5.76-build/bluez-5.76/src/log.h:56:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘battery’
bluez-5.76-build/bluez-5.76/src/log.h:60:9: note: in expansion of macro ‘DBG_IDX’
bluez-5.76-build/bluez-5.76/src/battery.c:222:9: note: in expansion of macro ‘DBG’
bluez-5.76-build/bluez-5.76/src/log.h:60:9: note: in expansion of macro ‘DBG_IDX’
bluez-5.76-build/bluez-5.76/src/battery.c:222:9: note: in expansion of macro ‘DBG’
bluez-5.76-build/bluez-5.76/src/log.h:60:9: note: in expansion of macro ‘DBG_IDX’
bluez-5.76-build/bluez-5.76/src/battery.c:222:9: note: in expansion of macro ‘DBG’
bluez-5.76-build/bluez-5.76/src/log.h:60:9: note: in expansion of macro ‘DBG_IDX’
bluez-5.76-build/bluez-5.76/src/battery.c:222:9: note: in expansion of macro ‘DBG’
#   54|   	}; \
#   55|   	if (__btd_debug_desc.flags & BTD_DEBUG_FLAG_PRINT) \
#   56|-> 		btd_debug(idx, fmt, ## arg); \
#   57|   } while (0)
#   58|   

Error: CPPCHECK_WARNING: [#def221]
bluez-5.76-build/bluez-5.76/src/main.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def222]
bluez-5.76-build/bluez-5.76/src/oui.c:50:2: warning[deadcode.DeadStores]: Value stored to 'hwdb' is never read
#   48|   	}
#   49|   
#   50|-> 	hwdb = udev_hwdb_unref(hwdb);
#   51|   
#   52|   done:

Error: CLANG_WARNING: [#def223]
bluez-5.76-build/bluez-5.76/src/oui.c:53:2: warning[deadcode.DeadStores]: Value stored to 'udev' is never read
#   51|   
#   52|   done:
#   53|-> 	udev = udev_unref(udev);
#   54|   
#   55|   	return comp;

Error: CPPCHECK_WARNING: [#def224]
bluez-5.76-build/bluez-5.76/src/plugin.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def225]
bluez-5.76-build/bluez-5.76/src/profile.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def226]
bluez-5.76-build/bluez-5.76/src/rfkill.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def227]
bluez-5.76-build/bluez-5.76/src/sdp-client.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def228]
bluez-5.76-build/bluez-5.76/src/sdp-client.c:353:14: warning[core.NullDereference]: Access to field 'cb' results in a dereference of a null pointer
#  351|   		return err;
#  352|   
#  353|-> 	(*ctxt)->cb = cb;
#  354|   	(*ctxt)->destroy = destroy;
#  355|   	(*ctxt)->user_data = user_data;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def229]
bluez-5.76-build/bluez-5.76/src/sdp-client.c:353:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
bluez-5.76-build/bluez-5.76/src/sdp-client.c: scope_hint: In function ‘bt_search_service’
bluez-5.76-build/bluez-5.76/src/sdp-client.c: scope_hint: In function ‘bt_search_service’
bluez-5.76-build/bluez-5.76/src/sdp-client.c:15: included_from: Included from here.
#  351|   		return err;
#  352|   
#  353|-> 	(*ctxt)->cb = cb;
#  354|   	(*ctxt)->destroy = destroy;
#  355|   	(*ctxt)->user_data = user_data;

Error: CPPCHECK_WARNING: [#def230]
bluez-5.76-build/bluez-5.76/src/sdp-xml.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def231]
bluez-5.76-build/bluez-5.76/src/sdp-xml.c:126:10: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
#  124|   
#  125|   		buf[0] = data[i];
#  126|-> 		buf[1] = data[i + 1];
#  127|   
#  128|   		val.data[j++] = strtoul(buf, 0, 16);

Error: CLANG_WARNING: [#def232]
bluez-5.76-build/bluez-5.76/src/sdp-xml.c:300:11: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
#  298|   		for (; i < 32; i += 2) {
#  299|   			buf[0] = data[i];
#  300|-> 			buf[1] = data[i + 1];
#  301|   
#  302|   			val.data[i >> 1] = strtoul(buf, 0, 16);

Error: CLANG_WARNING: [#def233]
bluez-5.76-build/bluez-5.76/src/sdp-xml.c:338:11: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
#  336|   		for (i = 0; i < len; i += 2) {
#  337|   			buf[0] = data[i];
#  338|-> 			buf[1] = data[i + 1];
#  339|   
#  340|   			decoded[i >> 1] = strtoul(buf, 0, 16);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def234]
bluez-5.76-build/bluez-5.76/src/sdp-xml.c: scope_hint: In function ‘element_start.part.0’
bluez-5.76-build/bluez-5.76/src/sdp-xml.c:461:31: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  459|   	if (ctx_data->stack_head) {
#  460|   		struct sdp_xml_data *newelem = sdp_xml_data_alloc();
#  461|-> 		newelem->next = ctx_data->stack_head;
#  462|   		ctx_data->stack_head = newelem;
#  463|   	} else {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def235]
bluez-5.76-build/bluez-5.76/src/sdp-xml.c:465:44: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  463|   	} else {
#  464|   		ctx_data->stack_head = sdp_xml_data_alloc();
#  465|-> 		ctx_data->stack_head->next = NULL;
#  466|   	}
#  467|   

Error: CPPCHECK_WARNING: [#def236]
bluez-5.76-build/bluez-5.76/src/sdpd-request.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-688): [#def237]
bluez-5.76-build/bluez-5.76/src/sdpd-request.c: scope_hint: In function ‘sdp_cstate_alloc_buf’
bluez-5.76-build/bluez-5.76/src/sdpd-request.c:105:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘data’ where non-null expected
bluez-5.76-build/bluez-5.76/src/sdpd-request.c: scope_hint: In function ‘sdp_cstate_alloc_buf’
bluez-5.76-build/bluez-5.76/src/sdpd-request.c: scope_hint: In function ‘sdp_cstate_alloc_buf’
bluez-5.76-build/bluez-5.76/src/shared/util.h:215:16: note: in expansion of macro ‘be16_to_cpu’
bluez-5.76-build/bluez-5.76/src/shared/util.h:215:28: note: in expansion of macro ‘get_unaligned’
bluez-5.76-build/bluez-5.76/src/sdpd-request.c: scope_hint: In function ‘sdp_cstate_alloc_buf’
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
#  103|   	uint8_t *data = malloc(buf->data_size);
#  104|   
#  105|-> 	memcpy(data, buf->data, buf->data_size);
#  106|   	memset(cinfo, 0, sizeof(sdp_cont_info_t));
#  107|   	cinfo->buf.data = data;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def238]
bluez-5.76-build/bluez-5.76/src/sdpd-request.c:106:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘cinfo’ where non-null expected
bluez-5.76-build/bluez-5.76/src/sdpd-request.c: scope_hint: In function ‘sdp_cstate_alloc_buf’
bluez-5.76-build/bluez-5.76/src/sdpd-request.c: scope_hint: In function ‘sdp_cstate_alloc_buf’
bluez-5.76-build/bluez-5.76/src/shared/util.h:215:16: note: in expansion of macro ‘be16_to_cpu’
bluez-5.76-build/bluez-5.76/src/shared/util.h:215:28: note: in expansion of macro ‘get_unaligned’
bluez-5.76-build/bluez-5.76/src/sdpd-request.c: scope_hint: In function ‘sdp_cstate_alloc_buf’
<built-in>: note: argument 1 of ‘__builtin_memset’ must be non-null
#  104|   
#  105|   	memcpy(data, buf->data, buf->data_size);
#  106|-> 	memset(cinfo, 0, sizeof(sdp_cont_info_t));
#  107|   	cinfo->buf.data = data;
#  108|   	cinfo->buf.data_size = buf->data_size;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def239]
bluez-5.76-build/bluez-5.76/src/sdpd-request.c: scope_hint: In function ‘extract_des’
bluez-5.76-build/bluez-5.76/src/sdpd-request.c:203:42: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘aid’
bluez-5.76-build/bluez-5.76/src/sdpd-request.c: scope_hint: In function ‘extract_des’
bluez-5.76-build/bluez-5.76/src/sdpd-request.c: scope_hint: In function ‘extract_des’
bluez-5.76-build/bluez-5.76/src/shared/util.h:239:16: note: in expansion of macro ‘be32_to_cpu’
bluez-5.76-build/bluez-5.76/src/shared/util.h:239:28: note: in expansion of macro ‘get_unaligned’
bluez-5.76-build/bluez-5.76/src/sdpd-request.c: scope_hint: In function ‘extract_des’
bluez-5.76-build/bluez-5.76/src/shared/util.h:215:16: note: in expansion of macro ‘be16_to_cpu’
bluez-5.76-build/bluez-5.76/src/shared/util.h:215:28: note: in expansion of macro ‘get_unaligned’
bluez-5.76-build/bluez-5.76/src/sdpd-request.c: scope_hint: In function ‘extract_des’
#  201|   				struct attrid *aid;
#  202|   				aid = malloc(sizeof(struct attrid));
#  203|-> 				aid->dtd = dataType;
#  204|   				aid->uint16 = get_be16(p);
#  205|   				pElem = (char *) aid;

Error: CLANG_WARNING: [#def240]
bluez-5.76-build/bluez-5.76/src/sdpd-request.c:211:13: warning[unix.MallocSizeof]: Result of 'malloc' is converted to a pointer of type 'char', which is incompatible with sizeof operand type 'uint16_t'
#  209|   				memcpy(&tmp, p, sizeof(tmp));
#  210|   
#  211|-> 				pElem = malloc(sizeof(uint16_t));
#  212|   				put_be16(tmp, pElem);
#  213|   			}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def241]
bluez-5.76-build/bluez-5.76/src/sdpd-request.c:230:42: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘aid’
bluez-5.76-build/bluez-5.76/src/sdpd-request.c: scope_hint: In function ‘extract_des’
bluez-5.76-build/bluez-5.76/src/sdpd-request.c: scope_hint: In function ‘extract_des’
bluez-5.76-build/bluez-5.76/src/shared/util.h:239:16: note: in expansion of macro ‘be32_to_cpu’
bluez-5.76-build/bluez-5.76/src/shared/util.h:239:28: note: in expansion of macro ‘get_unaligned’
bluez-5.76-build/bluez-5.76/src/sdpd-request.c: scope_hint: In function ‘extract_des’
bluez-5.76-build/bluez-5.76/src/shared/util.h:215:16: note: in expansion of macro ‘be16_to_cpu’
bluez-5.76-build/bluez-5.76/src/shared/util.h:215:28: note: in expansion of macro ‘get_unaligned’
bluez-5.76-build/bluez-5.76/src/sdpd-request.c: scope_hint: In function ‘extract_des’
#  228|   				struct attrid *aid;
#  229|   				aid = malloc(sizeof(struct attrid));
#  230|-> 				aid->dtd = dataType;
#  231|   				aid->uint32 = get_be32(p);
#  232|   

Error: CLANG_WARNING: [#def242]
bluez-5.76-build/bluez-5.76/src/sdpd-request.c:239:13: warning[unix.MallocSizeof]: Result of 'malloc' is converted to a pointer of type 'char', which is incompatible with sizeof operand type 'uint32_t'
#  237|   				memcpy(&tmp, p, sizeof(tmp));
#  238|   
#  239|-> 				pElem = malloc(sizeof(uint32_t));
#  240|   				put_be32(tmp, pElem);
#  241|   			}

Error: GCC_ANALYZER_WARNING (CWE-688): [#def243]
bluez-5.76-build/bluez-5.76/src/sdpd-request.c: scope_hint: In function ‘process_request’
bluez-5.76-build/bluez-5.76/src/sdpd-request.c:1017:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘buf’ where non-null expected
bluez-5.76-build/bluez-5.76/src/sdpd-request.c: scope_hint: In function ‘process_request’
bluez-5.76-build/bluez-5.76/src/sdpd-request.c: scope_hint: In function ‘process_request’
<built-in>: note: argument 1 of ‘__builtin_memset’ must be non-null
# 1015|   	int status = SDP_INVALID_SYNTAX;
# 1016|   
# 1017|-> 	memset(buf, 0, USHRT_MAX);
# 1018|   	rsp.data = buf + sizeof(sdp_pdu_hdr_t);
# 1019|   	rsp.data_size = 0;

Error: CPPCHECK_WARNING: [#def244]
bluez-5.76-build/bluez-5.76/src/sdpd-server.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def245]
bluez-5.76-build/bluez-5.76/src/sdpd-service.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def246]
bluez-5.76-build/bluez-5.76/src/service.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def247]
bluez-5.76-build/bluez-5.76/src/settings.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def248]
bluez-5.76-build/bluez-5.76/src/shared/ad.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-688): [#def249]
bluez-5.76-build/bluez-5.76/src/shared/ad.c: scope_hint: In function 'ad_replace_data'
bluez-5.76-build/bluez-5.76/src/shared/ad.c:394:17: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
bluez-5.76-build/bluez-5.76/src/shared/ad.c:26: included_from: Included from here.
bluez-5.76-build/bluez-5.76/src/shared/ad.c:389:58: note: in expansion of macro 'UINT_TO_PTR'
<built-in>: note: argument 1 of '__builtin_memcpy' must be non-null
#  392|   			return false;
#  393|   		new_data->data = realloc(new_data->data, len);
#  394|-> 		memcpy(new_data->data, data, len);
#  395|   		new_data->len = len;
#  396|   		return true;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def250]
bluez-5.76-build/bluez-5.76/src/shared/ad.c: scope_hint: In function 'bt_ad_add_manufacturer_data'
bluez-5.76-build/bluez-5.76/src/shared/ad.c:852:17: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
bluez-5.76-build/bluez-5.76/src/shared/ad.c:847:49: note: in expansion of macro 'UINT_TO_PTR'
<built-in>: note: argument 1 of '__builtin_memcpy' must be non-null
#  850|   			return false;
#  851|   		new_data->data = realloc(new_data->data, len);
#  852|-> 		memcpy(new_data->data, data, len);
#  853|   		new_data->len = len;
#  854|   		return true;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def251]
bluez-5.76-build/bluez-5.76/src/shared/ad.c: scope_hint: In function 'bt_ad_add_service_data'
bluez-5.76-build/bluez-5.76/src/shared/ad.c:988:17: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
<built-in>: note: argument 1 of '__builtin_memcpy' must be non-null
#  986|   			return false;
#  987|   		new_data->data = realloc(new_data->data, len);
#  988|-> 		memcpy(new_data->data, data, len);
#  989|   		new_data->len = len;
#  990|   		return true;

Error: CPPCHECK_WARNING: [#def252]
bluez-5.76-build/bluez-5.76/src/shared/att.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def253]
bluez-5.76-build/bluez-5.76/src/shared/bap.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def254]
bluez-5.76-build/bluez-5.76/src/shared/bap.c: scope_hint: In function 'bap_stream_io_attach'
bluez-5.76-build/bluez-5.76/src/shared/bap.c:40:9: warning[-Wanalyzer-null-dereference]: dereference of NULL 'stream'
bluez-5.76-build/bluez-5.76/src/shared/bap.c:2290:9: note: in expansion of macro 'DBG'
bluez-5.76-build/bluez-5.76/src/shared/bap.c:2290:9: note: in expansion of macro 'DBG'
bluez-5.76-build/bluez-5.76/src/shared/bap.c:2290:9: note: in expansion of macro 'DBG'
bluez-5.76-build/bluez-5.76/src/shared/bap.c:2290:9: note: in expansion of macro 'DBG'
#   38|   #define ASE_UUID(_id) (_id < NUM_SINKS ? ASE_SINK_UUID : ASE_SOURCE_UUID)
#   39|   #define DBG(_bap, fmt, arg...) \
#   40|-> 	bap_debug(_bap, "%s:%s() " fmt, __FILE__, __func__, ## arg)
#   41|   
#   42|   #define LTV(_type, _bytes...) \

Error: GCC_ANALYZER_WARNING (CWE-476): [#def255]
bluez-5.76-build/bluez-5.76/src/shared/bap.c: scope_hint: In function 'bap_get_session.part.0'
bluez-5.76-build/bluez-5.76/src/shared/bap.c:642:18: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
#  640|   
#  641|   	bap = bt_bap_new(db, NULL);
#  642|-> 	bap->att = att;
#  643|   
#  644|   	bt_bap_attach(bap, NULL);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def256]
bluez-5.76-build/bluez-5.76/src/shared/bap.c: scope_hint: In function 'bap_send'
bluez-5.76-build/bluez-5.76/src/shared/bap.c:1454:50: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.76-build/bluez-5.76/src/shared/bap.c:1493:9: note: in expansion of macro 'DBG'
bluez-5.76-build/bluez-5.76/src/shared/bap.c:1493:9: note: in expansion of macro 'DBG'
bluez-5.76-build/bluez-5.76/src/shared/bap.c:1447:9: note: in expansion of macro 'DBG'
bluez-5.76-build/bluez-5.76/src/shared/bap.c:1447:9: note: in expansion of macro 'DBG'
# 1452|   	}
# 1453|   
# 1454|-> 	if (!gatt_db_attribute_get_char_data(ascs->ase_cp, NULL, &handle,
# 1455|   						NULL, NULL, NULL)) {
# 1456|   		DBG(bap, "Unable to find Control Point");

Error: GCC_ANALYZER_WARNING (CWE-476): [#def257]
bluez-5.76-build/bluez-5.76/src/shared/bap.c: scope_hint: In function 'bap_cp_attach'
bluez-5.76-build/bluez-5.76/src/shared/bap.c:4677:50: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
# 4675|   	struct bt_ascs *ascs = bap_get_ascs(bap);
# 4676|   
# 4677|-> 	if (!gatt_db_attribute_get_char_data(ascs->ase_cp, NULL,
# 4678|   						&value_handle,
# 4679|   						NULL, NULL, NULL))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def258]
bluez-5.76-build/bluez-5.76/src/shared/bap.c: scope_hint: In function 'foreach_ascs_service'
bluez-5.76-build/bluez-5.76/src/shared/bap.c:4742:23: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
# 4740|   	struct bt_ascs *ascs = bap_get_ascs(bap);
# 4741|   
# 4742|-> 	ascs->service = attr;
# 4743|   
# 4744|   	gatt_db_service_set_claimed(attr, true);

Error: GCC_ANALYZER_WARNING (CWE-465): [#def259]
bluez-5.76-build/bluez-5.76/src/shared/bap.c: scope_hint: In function 'bap_bcast_stream_new'
bluez-5.76-build/bluez-5.76/src/shared/bap.c:5403:20: warning[-Wanalyzer-deref-before-check]: check of 'lpac' for NULL after already dereferencing it
# 5401|   
# 5402|   		bt_bap_foreach_pac(bap, BT_BAP_BCAST_SINK, match_pac, &match);
# 5403|-> 		if ((!match.lpac) || (!lpac))
# 5404|   			return NULL;
# 5405|   

Error: CPPCHECK_WARNING: [#def260]
bluez-5.76-build/bluez-5.76/src/shared/bass.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def261]
bluez-5.76-build/bluez-5.76/src/shared/bass.c: scope_hint: In function 'bass_build_bcast_src'
bluez-5.76-build/bluez-5.76/src/shared/bass.c:294:17: warning[-Wanalyzer-null-dereference]: dereference of NULL 'bad_code'
#  292|   
#  293|   	if (enc == BT_BASS_BIG_ENC_STATE_BAD_CODE)
#  294|-> 		memcpy(bcast_src->bad_code, bad_code, BT_BASS_BCAST_CODE_SIZE);
#  295|   	else
#  296|   		memset(bcast_src->bad_code, 0, BT_BASS_BCAST_CODE_SIZE);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def262]
bluez-5.76-build/bluez-5.76/src/shared/bass.c: scope_hint: In function 'bass_get_session.part.0'
bluez-5.76-build/bluez-5.76/src/shared/bass.c:755:19: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
#  753|   
#  754|   	bass = bt_bass_new(db, NULL, adapter_bdaddr);
#  755|-> 	bass->att = att;
#  756|   
#  757|   	bt_bass_attach(bass, NULL);

Error: CPPCHECK_WARNING: [#def263]
bluez-5.76-build/bluez-5.76/src/shared/btsnoop.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def264]
bluez-5.76-build/bluez-5.76/src/shared/ccp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def265]
bluez-5.76-build/bluez-5.76/src/shared/ccp.c: scope_hint: In function 'bt_ccp_incom_call_attach'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:661:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:659:9: note: in expansion of macro 'DBG'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:659:9: note: in expansion of macro 'DBG'
#  659|   	DBG(ccp, "");
#  660|   
#  661|-> 	if (!gatt_db_attribute_get_char_data(ccs->incoming_call, NULL,
#  662|   					     &value_handle,
#  663|   					     NULL, NULL, NULL))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def266]
bluez-5.76-build/bluez-5.76/src/shared/ccp.c: scope_hint: In function 'bt_ccp_call_state_attach'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:683:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:681:9: note: in expansion of macro 'DBG'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:681:9: note: in expansion of macro 'DBG'
#  681|   	DBG(ccp, "");
#  682|   
#  683|-> 	if (!gatt_db_attribute_get_char_data(ccs->call_state, NULL,
#  684|   					     &value_handle,
#  685|   					     NULL, NULL, NULL))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def267]
bluez-5.76-build/bluez-5.76/src/shared/ccp.c: scope_hint: In function 'bt_ccp_call_list_attach'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:705:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:703:9: note: in expansion of macro 'DBG'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:703:9: note: in expansion of macro 'DBG'
#  703|   	DBG(ccp, "");
#  704|   
#  705|-> 	if (!gatt_db_attribute_get_char_data(ccs->current_call_list, NULL,
#  706|   					     &value_handle,
#  707|   					     NULL, NULL, NULL))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def268]
bluez-5.76-build/bluez-5.76/src/shared/ccp.c: scope_hint: In function 'bt_ccp_name_attach'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:727:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:725:9: note: in expansion of macro 'DBG'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:725:9: note: in expansion of macro 'DBG'
#  725|   	DBG(ccp, "");
#  726|   
#  727|-> 	if (!gatt_db_attribute_get_char_data(ccs->bearer_name, NULL,
#  728|   					     &value_handle,
#  729|   					     NULL, NULL, NULL))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def269]
bluez-5.76-build/bluez-5.76/src/shared/ccp.c: scope_hint: In function 'bt_ccp_term_reason_attach'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:749:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:747:9: note: in expansion of macro 'DBG'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:747:9: note: in expansion of macro 'DBG'
#  747|   	DBG(ccp, "");
#  748|   
#  749|-> 	if (!gatt_db_attribute_get_char_data(ccs->termination_reason, NULL,
#  750|   					     &value_handle, NULL, NULL, NULL))
#  751|   		return;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def270]
bluez-5.76-build/bluez-5.76/src/shared/ccp.c: scope_hint: In function 'bt_ccp_status_attach'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:770:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:768:9: note: in expansion of macro 'DBG'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:768:9: note: in expansion of macro 'DBG'
#  768|   	DBG(ccp, "");
#  769|   
#  770|-> 	if (!gatt_db_attribute_get_char_data(ccs->status_flag, NULL,
#  771|   					     &value_handle,
#  772|   					     NULL, NULL, NULL))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def271]
bluez-5.76-build/bluez-5.76/src/shared/ccp.c: scope_hint: In function 'bt_ccp_uci_attach'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:792:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:790:9: note: in expansion of macro 'DBG'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:790:9: note: in expansion of macro 'DBG'
#  790|   	DBG(ccp, "");
#  791|   
#  792|-> 	if (!gatt_db_attribute_get_char_data(ccs->bearer_uci, NULL,
#  793|   					     &value_handle,
#  794|   					     NULL, NULL, NULL))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def272]
bluez-5.76-build/bluez-5.76/src/shared/ccp.c: scope_hint: In function 'bt_ccp_technology_attach'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:813:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:811:9: note: in expansion of macro 'DBG'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:811:9: note: in expansion of macro 'DBG'
#  811|   	DBG(ccp, "");
#  812|   
#  813|-> 	if (!gatt_db_attribute_get_char_data(ccs->bearer_technology, NULL,
#  814|   					     &value_handle,
#  815|   					     NULL, NULL, NULL))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def273]
bluez-5.76-build/bluez-5.76/src/shared/ccp.c: scope_hint: In function 'bt_ccp_strength_attach'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:833:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:831:9: note: in expansion of macro 'DBG'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:831:9: note: in expansion of macro 'DBG'
#  831|   	DBG(ccp, "");
#  832|   
#  833|-> 	if (!gatt_db_attribute_get_char_data(ccs->signal_strength, NULL,
#  834|   					     &value_handle,
#  835|   					     NULL, NULL, NULL))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def274]
bluez-5.76-build/bluez-5.76/src/shared/ccp.c: scope_hint: In function 'bt_ccp_ccid_attach'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:853:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:851:9: note: in expansion of macro 'DBG'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:851:9: note: in expansion of macro 'DBG'
#  851|   	DBG(ccp, "");
#  852|   
#  853|-> 	if (!gatt_db_attribute_get_char_data(ccs->ccid, NULL, &value_handle,
#  854|   					     NULL, NULL, NULL))
#  855|   		return;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def275]
bluez-5.76-build/bluez-5.76/src/shared/ccp.c: scope_hint: In function 'bt_ccp_tar_uri_attach'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:872:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:870:9: note: in expansion of macro 'DBG'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:870:9: note: in expansion of macro 'DBG'
#  870|   	DBG(ccp, "");
#  871|   
#  872|-> 	if (!gatt_db_attribute_get_char_data(ccs->target_bearer_uri, NULL,
#  873|   					     &value_handle,
#  874|   					     NULL, NULL, NULL))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def276]
bluez-5.76-build/bluez-5.76/src/shared/ccp.c: scope_hint: In function 'bt_ccp_ctrl_point_attach'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:893:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:891:9: note: in expansion of macro 'DBG'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:891:9: note: in expansion of macro 'DBG'
#  891|   	DBG(ccp, "");
#  892|   
#  893|-> 	if (!gatt_db_attribute_get_char_data(ccs->call_ctrl_point, NULL,
#  894|   					     &value_handle,
#  895|   					     NULL, NULL, NULL))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def277]
bluez-5.76-build/bluez-5.76/src/shared/ccp.c: scope_hint: In function 'bt_ccp_ctrl_opcode_attach'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:913:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:911:9: note: in expansion of macro 'DBG'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:911:9: note: in expansion of macro 'DBG'
#  911|   	DBG(ccp, "");
#  912|   
#  913|-> 	if (!gatt_db_attribute_get_char_data(ccs->call_ctrl_opt_opcode, NULL,
#  914|   					     &value_handle,
#  915|   					     NULL, NULL, NULL))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def278]
bluez-5.76-build/bluez-5.76/src/shared/ccp.c: scope_hint: In function 'bt_ccp_friendly_name_attach'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:933:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:931:9: note: in expansion of macro 'DBG'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:931:9: note: in expansion of macro 'DBG'
#  931|   	DBG(ccp, "");
#  932|   
#  933|-> 	if (!gatt_db_attribute_get_char_data(ccs->friendly_name, NULL,
#  934|   					     &value_handle,
#  935|   					     NULL, NULL, NULL))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def279]
bluez-5.76-build/bluez-5.76/src/shared/ccp.c: scope_hint: In function 'bt_ccp_signal_intrvl_attach'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:953:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:951:9: note: in expansion of macro 'DBG'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:951:9: note: in expansion of macro 'DBG'
#  951|   	DBG(ccp, "");
#  952|   
#  953|-> 	if (!gatt_db_attribute_get_char_data(ccs->signal_reporting_intrvl, NULL,
#  954|   					     &value_handle,
#  955|   					     NULL, NULL, NULL))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def280]
bluez-5.76-build/bluez-5.76/src/shared/ccp.c: scope_hint: In function 'bt_ccp_uri_list_attach'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:973:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:971:9: note: in expansion of macro 'DBG'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:971:9: note: in expansion of macro 'DBG'
#  971|   	DBG(ccp, "");
#  972|   
#  973|-> 	if (!gatt_db_attribute_get_char_data(ccs->bearer_uri_schemes_list, NULL,
#  974|   					     &value_handle,
#  975|   					     NULL, NULL, NULL))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def281]
bluez-5.76-build/bluez-5.76/src/shared/ccp.c: scope_hint: In function 'foreach_ccs_service'
bluez-5.76-build/bluez-5.76/src/shared/ccp.c:1129:22: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
# 1127|   	struct bt_ccs *ccs = ccp_get_ccs(ccp);
# 1128|   
# 1129|-> 	ccs->service = attr;
# 1130|   
# 1131|   	gatt_db_service_foreach_char(attr, foreach_ccs_char, ccp);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def282]
bluez-5.76-build/bluez-5.76/src/shared/crypto.c: scope_hint: In function 'alg_new'
bluez-5.76-build/bluez-5.76/src/shared/crypto.c:212:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor '*crypto.cmac_aes'
#  210|   
#  211|   	/* FIXME: This should use accept4() with SOCK_CLOEXEC */
#  212|-> 	return accept(fd, NULL, 0);
#  213|   }
#  214|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def283]
bluez-5.76-build/bluez-5.76/src/shared/crypto.c:212:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor '*crypto.ecb_aes'
bluez-5.76-build/bluez-5.76/src/shared/crypto.c: scope_hint: In function 'alg_new'
#  210|   
#  211|   	/* FIXME: This should use accept4() with SOCK_CLOEXEC */
#  212|-> 	return accept(fd, NULL, 0);
#  213|   }
#  214|   

Error: CPPCHECK_WARNING: [#def284]
bluez-5.76-build/bluez-5.76/src/shared/csip.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def285]
bluez-5.76-build/bluez-5.76/src/shared/csip.c: scope_hint: In function 'foreach_csis_service'
bluez-5.76-build/bluez-5.76/src/shared/csip.c:605:23: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
#  603|   	struct bt_csis *csis = csip_get_csis(csip);
#  604|   
#  605|-> 	csis->service = attr;
#  606|   
#  607|   	gatt_db_service_set_claimed(attr, true);

Error: CPPCHECK_WARNING: [#def286]
bluez-5.76-build/bluez-5.76/src/shared/ecc.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-457): [#def287]
bluez-5.76-build/bluez-5.76/src/shared/ecc.c:903: error[uninitvar]: Uninitialized variable: &pk
#  901|   	ecc_bytes2native(&public_key[32], pk.y);
#  902|   
#  903|-> 	return ecc_valid_point(&pk);
#  904|   }
#  905|   

Error: CPPCHECK_WARNING (CWE-457): [#def288]
bluez-5.76-build/bluez-5.76/src/shared/ecc.c:920: error[uninitvar]: Uninitialized variable: &pk
#  918|   	ecc_bytes2native(&public_key[32], pk.y);
#  919|   
#  920|-> 	if (!ecc_valid_point(&pk))
#  921|   		return false;
#  922|   

Error: CPPCHECK_WARNING: [#def289]
bluez-5.76-build/bluez-5.76/src/shared/gap.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def290]
bluez-5.76-build/bluez-5.76/src/shared/gatt-client.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-416): [#def291]
bluez-5.76-build/bluez-5.76/src/shared/gatt-client.c: scope_hint: In function 'request_unref'
bluez-5.76-build/bluez-5.76/src/shared/gatt-client.c:199:32: warning[-Wanalyzer-use-after-free]: use after 'free' of 'data'
#  197|   {
#  198|   	struct request *req = data;
#  199|-> 	struct bt_gatt_client *client = req->client;
#  200|   
#  201|   	if (__sync_sub_and_fetch(&req->ref_count, 1))

Error: CLANG_WARNING: [#def292]
bluez-5.76-build/bluez-5.76/src/shared/gatt-client.c:451:21: warning[unix.Malloc]: Use of memory after it is freed
#  449|   	 * range.
#  450|   	 */
#  451|-> 	gatt_db_unregister(op->client->db, op->db_id);
#  452|   	op->db_id = 0;
#  453|   

Error: CLANG_WARNING: [#def293]
bluez-5.76-build/bluez-5.76/src/shared/gatt-client.c:696:2: warning[unix.Malloc]: Use of memory after it is freed
#  694|   	discovery_op_unref(op);
#  695|   failed:
#  696|-> 	discovery_op_complete(op, false, att_ecode);
#  697|   }
#  698|   

Error: CLANG_WARNING: [#def294]
bluez-5.76-build/bluez-5.76/src/shared/gatt-client.c:996:2: warning[unix.Malloc]: Use of memory after it is freed
#  994|   
#  995|   done:
#  996|-> 	discovery_op_complete(op, success, att_ecode);
#  997|   }
#  998|   

Error: CLANG_WARNING: [#def295]
bluez-5.76-build/bluez-5.76/src/shared/gatt-client.c:1102:2: warning[unix.Malloc]: Use of memory after it is freed
# 1100|   
# 1101|   done:
# 1102|-> 	discovery_op_complete(op, success, att_ecode);
# 1103|   }
# 1104|   

Error: CLANG_WARNING: [#def296]
bluez-5.76-build/bluez-5.76/src/shared/gatt-client.c:1294:2: warning[unix.Malloc]: Use of memory after it is freed
# 1292|   
# 1293|   done:
# 1294|-> 	discovery_op_complete(op, success, att_ecode);
# 1295|   }
# 1296|   

Error: CLANG_WARNING: [#def297]
bluez-5.76-build/bluez-5.76/src/shared/gatt-client.c:1359:2: warning[unix.Malloc]: Use of memory after it is freed
# 1357|   
# 1358|   done:
# 1359|-> 	discovery_op_complete(op, success, att_ecode);
# 1360|   }
# 1361|   

Error: CLANG_WARNING: [#def298]
bluez-5.76-build/bluez-5.76/src/shared/gatt-client.c:1634:6: warning[unix.Malloc]: Use of memory after it is freed
# 1632|   	read_server_feat(op);
# 1633|   
# 1634|-> 	if (read_db_hash(op)) {
# 1635|   		op->success = false;
# 1636|   		return;

Error: CLANG_WARNING: [#def299]
bluez-5.76-build/bluez-5.76/src/shared/gatt-client.c:1639:2: warning[unix.Malloc]: Use of memory after it is freed
# 1637|   	}
# 1638|   
# 1639|-> 	discover_all(op);
# 1640|   }
# 1641|   

Error: CLANG_WARNING: [#def300]
bluez-5.76-build/bluez-5.76/src/shared/gatt-client.c:2143:6: warning[unix.Malloc]: Use of memory after it is freed
# 2141|   	read_server_feat(op);
# 2142|   
# 2143|-> 	if (read_db_hash(op)) {
# 2144|   		op->success = false;
# 2145|   		goto done;

Error: CLANG_WARNING: [#def301]
bluez-5.76-build/bluez-5.76/src/shared/gatt-client.c:2151:8: warning[unix.Malloc]: Use of memory after it is freed
# 2149|   							client->att, NULL,
# 2150|   							discover_primary_cb,
# 2151|-> 							discovery_op_ref(op),
# 2152|   							discovery_op_unref);
# 2153|   	if (!client->discovery_req) {

Error: CLANG_WARNING: [#def302]
bluez-5.76-build/bluez-5.76/src/shared/gatt-client.c:3240:2: warning[unix.Malloc]: Use of memory after it is freed
# 3238|   
# 3239|   done:
# 3240|-> 	complete_write_long_op(req, success, 0, false);
# 3241|   }
# 3242|   

Error: CLANG_WARNING: [#def303]
bluez-5.76-build/bluez-5.76/src/shared/gatt-client.c:3262:2: warning[unix.Malloc]: Use of memory after it is freed
# 3260|   	 * necessary, since we also added a ref before pushing to the queue.
# 3261|   	 */
# 3262|-> 	request_unref(req);
# 3263|   }
# 3264|   

Error: GCC_ANALYZER_WARNING (CWE-416): [#def304]
bluez-5.76-build/bluez-5.76/src/shared/gatt-client.c: scope_hint: In function 'complete_write_long_op'
bluez-5.76-build/bluez-5.76/src/shared/gatt-client.c:3293:31: warning[-Wanalyzer-use-after-free]: use after 'free' of 'req'
# 3291|   					uint8_t att_ecode, bool reliable_error)
# 3292|   {
# 3293|-> 	struct long_write_op *op = req->data;
# 3294|   	uint8_t pdu;
# 3295|   	int err;

Error: CPPCHECK_WARNING: [#def305]
bluez-5.76-build/bluez-5.76/src/shared/gatt-db.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def306]
bluez-5.76-build/bluez-5.76/src/shared/gatt-db.c: scope_hint: In function 'read_ext_prop_value'
bluez-5.76-build/bluez-5.76/src/shared/gatt-db.c:1831:37: warning[-Wanalyzer-null-dereference]: dereference of NULL 'value'
# 1829|   		return;
# 1830|   
# 1831|-> 	*ext_prop = (uint16_t) value[0];
# 1832|   }
# 1833|   

Error: CPPCHECK_WARNING: [#def307]
bluez-5.76-build/bluez-5.76/src/shared/gatt-helpers.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def308]
bluez-5.76-build/bluez-5.76/src/shared/gatt-server.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-457): [#def309]
bluez-5.76-build/bluez-5.76/src/shared/gatt-server.c: scope_hint: In function 'read_by_grp_type_cb'
bluez-5.76-build/bluez-5.76/src/shared/gatt-server.c:322:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'type'
bluez-5.76-build/bluez-5.76/src/shared/att.h:11: included_from: Included from here.
bluez-5.76-build/bluez-5.76/src/shared/gatt-server.c:19: included_from: Included from here.
bluez-5.76-build/bluez-5.76/src/shared/gatt-server.c:295:9: note: in expansion of macro 'DBG'
bluez-5.76-build/bluez-5.76/src/shared/gatt-server.c:295:9: note: in expansion of macro 'DBG'
#  320|   	}
#  321|   
#  322|-> 	gatt_db_read_by_group_type(server->db, start, end, type, q);
#  323|   
#  324|   	if (queue_isempty(q)) {

Error: GCC_ANALYZER_WARNING (CWE-457): [#def310]
bluez-5.76-build/bluez-5.76/src/shared/gatt-server.c: scope_hint: In function 'read_by_type_cb'
bluez-5.76-build/bluez-5.76/src/shared/gatt-server.c:531:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'type'
#  529|   	}
#  530|   
#  531|-> 	gatt_db_read_by_type(server->db, start, end, type, q);
#  532|   
#  533|   	if (queue_isempty(q)) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def311]
bluez-5.76-build/bluez-5.76/src/shared/gatt-server.c: scope_hint: In function 'prep_write_cb'
bluez-5.76-build/bluez-5.76/src/shared/gatt-server.c:1350:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'malloc((long unsigned int)length)' where non-null expected
bluez-5.76-build/bluez-5.76/src/shared/util.h:26:27: note: in definition of macro 'le16_to_cpu'
bluez-5.76-build/bluez-5.76/src/shared/util.h:210:28: note: in expansion of macro 'get_unaligned'
bluez-5.76-build/bluez-5.76/src/shared/gatt-server.c: scope_hint: In function 'prep_write_cb'
bluez-5.76-build/bluez-5.76/src/shared/gatt-server.c:1337:9: note: in expansion of macro 'DBG'
bluez-5.76-build/bluez-5.76/src/shared/gatt-server.c:1337:9: note: in expansion of macro 'DBG'
bluez-5.76-build/bluez-5.76/src/shared/gatt-server.c:1337:9: note: in expansion of macro 'DBG'
bluez-5.76-build/bluez-5.76/src/shared/gatt-server.c: scope_hint: In function 'prep_write_cb'
bluez-5.76-build/bluez-5.76/src/shared/gatt-server.c:1347:16: note: in expansion of macro 'new0'
<built-in>: note: argument 1 of '__builtin_memcpy' must be non-null
# 1348|   	pwcd->chan = chan;
# 1349|   	pwcd->pdu = malloc(length);
# 1350|-> 	memcpy(pwcd->pdu, pdu, length);
# 1351|   	pwcd->length = length;
# 1352|   	pwcd->server = server;

Error: CPPCHECK_WARNING: [#def312]
bluez-5.76-build/bluez-5.76/src/shared/hfp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def313]
bluez-5.76-build/bluez-5.76/src/shared/io-ell.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def314]
bluez-5.76-build/bluez-5.76/src/shared/mainloop-ell.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def315]
bluez-5.76-build/bluez-5.76/src/shared/mainloop-notify.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def316]
bluez-5.76-build/bluez-5.76/src/shared/mcp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def317]
bluez-5.76-build/bluez-5.76/src/shared/mcp.c: scope_hint: In function 'mcp_send'
bluez-5.76-build/bluez-5.76/src/shared/mcp.c:586:17: warning[-Wanalyzer-null-dereference]: dereference of NULL 'mcp'
bluez-5.76-build/bluez-5.76/src/shared/mcp.c:584:9: note: in expansion of macro 'DBG'
bluez-5.76-build/bluez-5.76/src/shared/mcp.c:584:9: note: in expansion of macro 'DBG'
#  584|   	DBG(mcp, "mcs %p", mcs);
#  585|   
#  586|-> 	if (!mcp->client)
#  587|   		return -1;
#  588|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def318]
bluez-5.76-build/bluez-5.76/src/shared/mcp.c: scope_hint: In function 'bt_mcp_mp_name_attach'
bluez-5.76-build/bluez-5.76/src/shared/mcp.c:1008:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
# 1006|   	struct bt_mcs *mcs = mcp_get_mcs(mcp);
# 1007|   
# 1008|-> 	if (!gatt_db_attribute_get_char_data(mcs->mp_name, NULL, &value_handle,
# 1009|   						NULL, NULL, NULL))
# 1010|   		return;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def319]
bluez-5.76-build/bluez-5.76/src/shared/mcp.c: scope_hint: In function 'bt_mcp_track_changed_attach'
bluez-5.76-build/bluez-5.76/src/shared/mcp.c:1026:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
# 1024|   	struct bt_mcs *mcs = mcp_get_mcs(mcp);
# 1025|   
# 1026|-> 	if (!gatt_db_attribute_get_char_data(mcs->track_changed, NULL,
# 1027|   				&value_handle, NULL, NULL, NULL))
# 1028|   		return;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def320]
bluez-5.76-build/bluez-5.76/src/shared/mcp.c: scope_hint: In function 'bt_mcp_track_title_attach'
bluez-5.76-build/bluez-5.76/src/shared/mcp.c:1042:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
# 1040|   	struct bt_mcs *mcs = mcp_get_mcs(mcp);
# 1041|   
# 1042|-> 	if (!gatt_db_attribute_get_char_data(mcs->track_title, NULL,
# 1043|   				&value_handle, NULL, NULL, NULL))
# 1044|   		return;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def321]
bluez-5.76-build/bluez-5.76/src/shared/mcp.c: scope_hint: In function 'bt_mcp_track_duration_attach'
bluez-5.76-build/bluez-5.76/src/shared/mcp.c:1060:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
# 1058|   	struct bt_mcs *mcs = mcp_get_mcs(mcp);
# 1059|   
# 1060|-> 	if (!gatt_db_attribute_get_char_data(mcs->track_duration, NULL,
# 1061|   				&value_handle, NULL, NULL, NULL))
# 1062|   		return;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def322]
bluez-5.76-build/bluez-5.76/src/shared/mcp.c: scope_hint: In function 'bt_mcp_track_position_attach'
bluez-5.76-build/bluez-5.76/src/shared/mcp.c:1078:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
# 1076|   	struct bt_mcs *mcs = mcp_get_mcs(mcp);
# 1077|   
# 1078|-> 	if (!gatt_db_attribute_get_char_data(mcs->track_position, NULL,
# 1079|   				&value_handle, NULL, NULL, NULL))
# 1080|   		return;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def323]
bluez-5.76-build/bluez-5.76/src/shared/mcp.c: scope_hint: In function 'bt_mcp_media_state_attach'
bluez-5.76-build/bluez-5.76/src/shared/mcp.c:1096:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
# 1094|   	struct bt_mcs *mcs = mcp_get_mcs(mcp);
# 1095|   
# 1096|-> 	if (!gatt_db_attribute_get_char_data(mcs->media_state, NULL,
# 1097|   				&value_handle, NULL, NULL, NULL))
# 1098|   		return;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def324]
bluez-5.76-build/bluez-5.76/src/shared/mcp.c: scope_hint: In function 'bt_mcp_media_cp_attach'
bluez-5.76-build/bluez-5.76/src/shared/mcp.c:1114:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
# 1112|   	struct bt_mcs *mcs = mcp_get_mcs(mcp);
# 1113|   
# 1114|-> 	if (!gatt_db_attribute_get_char_data(mcs->media_cp, NULL,
# 1115|   				&value_handle, NULL, NULL, NULL))
# 1116|   		return;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def325]
bluez-5.76-build/bluez-5.76/src/shared/mcp.c: scope_hint: In function 'bt_mcp_media_cp_op_supported_attach'
bluez-5.76-build/bluez-5.76/src/shared/mcp.c:1130:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
# 1128|   	struct bt_mcs *mcs = mcp_get_mcs(mcp);
# 1129|   
# 1130|-> 	if (!gatt_db_attribute_get_char_data(mcs->media_cp_op_supportd, NULL,
# 1131|   				&value_handle, NULL, NULL, NULL))
# 1132|   		return;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def326]
bluez-5.76-build/bluez-5.76/src/shared/mcp.c: scope_hint: In function 'bt_mcp_content_control_id_supported_attach'
bluez-5.76-build/bluez-5.76/src/shared/mcp.c:1149:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
# 1147|   	struct bt_mcs *mcs = mcp_get_mcs(mcp);
# 1148|   
# 1149|-> 	if (!gatt_db_attribute_get_char_data(mcs->content_control_id, NULL,
# 1150|   				&value_handle, NULL, NULL, NULL))
# 1151|   		return;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def327]
bluez-5.76-build/bluez-5.76/src/shared/mcp.c: scope_hint: In function 'foreach_mcs_service'
bluez-5.76-build/bluez-5.76/src/shared/mcp.c:1313:22: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.76-build/bluez-5.76/src/shared/mcp.c:1311:9: note: in expansion of macro 'DBG'
bluez-5.76-build/bluez-5.76/src/shared/mcp.c:1311:9: note: in expansion of macro 'DBG'
# 1311|   	DBG(mcp, "");
# 1312|   
# 1313|-> 	mcs->service = attr;
# 1314|   
# 1315|   	gatt_db_service_foreach_char(attr, foreach_mcs_char, mcp);

Error: CPPCHECK_WARNING: [#def328]
bluez-5.76-build/bluez-5.76/src/shared/mgmt.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def329]
bluez-5.76-build/bluez-5.76/src/shared/micp.c: scope_hint: In function 'micp_get_session'
bluez-5.76-build/bluez-5.76/src/shared/micp.c:271:19: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
#  269|   
#  270|   	micp = bt_micp_new(db, NULL);
#  271|-> 	micp->att = att;
#  272|   
#  273|   	bt_att_register_disconnect(att, micp_disconnected, micp, NULL);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def330]
bluez-5.76-build/bluez-5.76/src/shared/micp.c: scope_hint: In function 'mics_muted'
bluez-5.76-build/bluez-5.76/src/shared/micp.c:339:21: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.76-build/bluez-5.76/src/shared/micp.c: scope_hint: In function 'mics_muted'
bluez-5.76-build/bluez-5.76/src/shared/micp.c: scope_hint: In function 'mics_muted'
#  337|   	mute_state = mdb_get_mute_state(mdb);
#  338|   
#  339|-> 	*mute_state = MICS_MUTED;
#  340|   
#  341|   	gatt_db_attribute_notify(mdb->mics->ms, (void *)mute_state,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def331]
bluez-5.76-build/bluez-5.76/src/shared/micp.c: scope_hint: In function 'mics_mute_write'
bluez-5.76-build/bluez-5.76/src/shared/micp.c:417:13: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.76-build/bluez-5.76/src/shared/micp.c: scope_hint: In function 'mics_mute_write'
bluez-5.76-build/bluez-5.76/src/shared/micp.c: scope_hint: In function 'mics_mute_write'
bluez-5.76-build/bluez-5.76/src/shared/micp.c: scope_hint: In function 'mics_mute_write'
#  415|   
#  416|   	mute_state = mdb_get_mute_state(mdb);
#  417|-> 	if (*mute_state == MICS_DISABLED) {
#  418|   		DBG(micp, "state: MICS DISABLED , can not write value: %d",
#  419|   				*micp_op);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def332]
bluez-5.76-build/bluez-5.76/src/shared/micp.c: scope_hint: In function 'foreach_mics_service'
bluez-5.76-build/bluez-5.76/src/shared/micp.c:782:23: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
#  780|   	struct bt_mics *mics = micp_get_mics(micp);
#  781|   
#  782|-> 	mics->service = attr;
#  783|   
#  784|   	gatt_db_service_set_claimed(attr, true);

Error: CPPCHECK_WARNING: [#def333]
bluez-5.76-build/bluez-5.76/src/shared/pcap.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def334]
bluez-5.76-build/bluez-5.76/src/shared/queue.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def335]
bluez-5.76-build/bluez-5.76/src/shared/shell.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-457): [#def336]
bluez-5.76-build/bluez-5.76/src/shared/shell.c: scope_hint: In function 'bt_shell_printf'
bluez-5.76-build/bluez-5.76/src/shared/shell.c:688:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'saved_line'
bluez-5.76-build/bluez-5.76/src/shared/shell.c:29: included_from: Included from here.
#  686|   		if (!data.saved_prompt)
#  687|   			rl_restore_prompt();
#  688|-> 		rl_replace_line(saved_line, 0);
#  689|   		rl_point = saved_point;
#  690|   		rl_forced_update_display();

Error: CLANG_WARNING: [#def337]
bluez-5.76-build/bluez-5.76/src/shared/shell.c:1331:13: warning[core.NullDereference]: Access to field 'options' results in a dereference of a null pointer (loaded from variable 'opt')
# 1329|   			}
# 1330|   
# 1331|-> 			if (c != opt->options[index - offset].val) {
# 1332|   				usage(argc, argv, opt);
# 1333|   				exit(EXIT_SUCCESS);

Error: CPPCHECK_WARNING: [#def338]
bluez-5.76-build/bluez-5.76/src/shared/tester.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def339]
bluez-5.76-build/bluez-5.76/src/shared/tester.c: scope_hint: In function 'tester_setup_io'
bluez-5.76-build/bluez-5.76/src/shared/tester.c:1041:19: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.76-build/bluez-5.76/src/shared/tester.c: scope_hint: In function 'tester_setup_io'
# 1039|   	}
# 1040|   
# 1041|-> 	test->iov = iov;
# 1042|   	test->iovcnt = iovcnt;
# 1043|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def340]
bluez-5.76-build/bluez-5.76/src/shared/tester.c: scope_hint: In function 'tester_io_send'
bluez-5.76-build/bluez-5.76/src/shared/tester.c:1051:17: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.76-build/bluez-5.76/src/shared/tester.c: scope_hint: In function 'tester_io_send'
# 1049|   	struct test_case *test = tester_get_test();
# 1050|   
# 1051|-> 	if (test->iovcnt)
# 1052|   		io_set_write_handler(ios[1], test_io_send, NULL, NULL);
# 1053|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def341]
bluez-5.76-build/bluez-5.76/src/shared/tester.c: scope_hint: In function 'tester_io_set_complete_func'
bluez-5.76-build/bluez-5.76/src/shared/tester.c:1059:32: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.76-build/bluez-5.76/src/shared/tester.c: scope_hint: In function 'tester_io_set_complete_func'
# 1057|   	struct test_case *test = tester_get_test();
# 1058|   
# 1059|-> 	test->io_complete_func = func;
# 1060|   }
# 1061|   

Error: CPPCHECK_WARNING: [#def342]
bluez-5.76-build/bluez-5.76/src/shared/timeout-ell.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def343]
bluez-5.76-build/bluez-5.76/src/shared/uhid.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def344]
bluez-5.76-build/bluez-5.76/src/shared/util.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-688): [#def345]
bluez-5.76-build/bluez-5.76/src/shared/util.c: scope_hint: In function 'util_iov_memcpy.part.0'
bluez-5.76-build/bluez-5.76/src/shared/util.c:379:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
<built-in>: note: argument 1 of '__builtin_memcpy' must be non-null
#  377|   	iov->iov_base = realloc(iov->iov_base, len);
#  378|   	iov->iov_len = len;
#  379|-> 	memcpy(iov->iov_base, src, len);
#  380|   }
#  381|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def346]
bluez-5.76-build/bluez-5.76/src/shared/util.c: scope_hint: In function 'strdelimit'
bluez-5.76-build/bluez-5.76/src/shared/util.c:1828:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'dup'
# 1826|   
# 1827|   	dup = strdup(str);
# 1828|-> 	if (dup[0] == '\0')
# 1829|   		return dup;
# 1830|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def347]
bluez-5.76-build/bluez-5.76/src/shared/util.h:60:12: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*(struct <anonymous> *)(&mic[0]).__v’
bluez-5.76-build/bluez-5.76/src/shared/util.h:239:16: note: in expansion of macro ‘be32_to_cpu’
bluez-5.76-build/bluez-5.76/src/shared/util.h:239:28: note: in expansion of macro ‘get_unaligned’
bluez-5.76-build/bluez-5.76/tools/mesh-gatt/crypto.c: scope_hint: In function ‘mesh_crypto_aes_ccm_decrypt’
bluez-5.76-build/bluez-5.76/src/shared/util.h:68:21: note: in definition of macro ‘put_unaligned’
bluez-5.76-build/bluez-5.76/src/shared/util.h:286:23: note: in expansion of macro ‘cpu_to_be32’
bluez-5.76-build/bluez-5.76/tools/mesh-gatt/crypto.c: scope_hint: In function ‘mesh_crypto_aes_ccm_decrypt’
bluez-5.76-build/bluez-5.76/tools/mesh-gatt/crypto.c: scope_hint: In function ‘mesh_crypto_aes_ccm_decrypt’
bluez-5.76-build/bluez-5.76/src/shared/util.h:239:16: note: in expansion of macro ‘be32_to_cpu’
bluez-5.76-build/bluez-5.76/src/shared/util.h:239:28: note: in expansion of macro ‘get_unaligned’
bluez-5.76-build/bluez-5.76/src/shared/util.h:239:16: note: in expansion of macro ‘be32_to_cpu’
bluez-5.76-build/bluez-5.76/src/shared/util.h:239:28: note: in expansion of macro ‘get_unaligned’
#   58|   		__typeof__(*(ptr)) __v;		\
#   59|   	} *__p = (__typeof__(__p)) (ptr);	\
#   60|-> 	__p->__v;				\
#   61|   })
#   62|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def348]
bluez-5.76-build/bluez-5.76/src/shared/util.h:68:18: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'data'
bluez-5.76-build/bluez-5.76/src/shared/util.h:259:9: note: in expansion of macro 'put_unaligned'
bluez-5.76-build/bluez-5.76/src/shared/gatt-db.c: scope_hint: In function 'gen_hash_m.part.0'
bluez-5.76-build/bluez-5.76/src/shared/util.h:259:9: note: in expansion of macro 'put_unaligned'
#   66|   		__typeof__(*(ptr)) __v;		\
#   67|   	} *__p = (__typeof__(__p)) (ptr);	\
#   68|-> 	__p->__v = (val);			\
#   69|   } while (0)
#   70|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def349]
bluez-5.76-build/bluez-5.76/src/shared/util.h:68:18: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pElem’
bluez-5.76-build/bluez-5.76/src/shared/util.h:264:9: note: in expansion of macro ‘put_unaligned’
bluez-5.76-build/bluez-5.76/src/sdpd-request.c: scope_hint: In function ‘extract_des’
bluez-5.76-build/bluez-5.76/src/sdpd-request.c: scope_hint: In function ‘extract_des’
bluez-5.76-build/bluez-5.76/src/sdpd-request.c: scope_hint: In function ‘extract_des’
bluez-5.76-build/bluez-5.76/src/shared/util.h:264:9: note: in expansion of macro ‘put_unaligned’
#   66|   		__typeof__(*(ptr)) __v;		\
#   67|   	} *__p = (__typeof__(__p)) (ptr);	\
#   68|-> 	__p->__v = (val);			\
#   69|   } while (0)
#   70|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def350]
bluez-5.76-build/bluez-5.76/src/shared/util.c:39: included_from: Included from here.
bluez-5.76-build/bluez-5.76/src/shared/util.c: scope_hint: In function 'util_iov_dup'
bluez-5.76-build/bluez-5.76/src/shared/util.h:83:17: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
bluez-5.76-build/bluez-5.76/src/shared/util.c:350:15: note: in expansion of macro 'new0'
bluez-5.76-build/bluez-5.76/src/shared/util.c:350:15: note: in expansion of macro 'new0'
bluez-5.76-build/bluez-5.76/src/shared/util.c:350:15: note: in expansion of macro 'new0'
bluez-5.76-build/bluez-5.76/src/shared/util.c:350:15: note: in expansion of macro 'new0'
bluez-5.76-build/bluez-5.76/src/shared/util.c:350:15: note: in expansion of macro 'new0'
<built-in>: note: argument 1 of '__builtin_memset' must be non-null
#   81|   		void *__p;			\
#   82|   		__p = util_malloc(__n * __s);	\
#   83|-> 		memset(__p, 0, __n * __s);	\
#   84|   		__p;				\
#   85|   	}))

Error: CLANG_WARNING: [#def351]
bluez-5.76-build/bluez-5.76/tools/mesh-gatt/crypto.c:32: included_from: Included from here.
bluez-5.76-build/bluez-5.76/src/shared/util.h:239:9: warning[core.CallAndMessage]: 1st function call argument is an uninitialized value
#  237|   static inline uint32_t get_be32(const void *ptr)
#  238|   {
#  239|-> 	return be32_to_cpu(get_unaligned((const uint32_t *) ptr));
#  240|   }
#  241|   

Error: CLANG_WARNING: [#def352]
bluez-5.76-build/bluez-5.76/tools/mesh-gatt/crypto.c:32: included_from: Included from here.
bluez-5.76-build/bluez-5.76/src/shared/util.h:249:9: warning[core.CallAndMessage]: 1st function call argument is an uninitialized value
#  247|   static inline uint64_t get_be64(const void *ptr)
#  248|   {
#  249|-> 	return be64_to_cpu(get_unaligned((const uint64_t *) ptr));
#  250|   }
#  251|   

Error: CPPCHECK_WARNING: [#def353]
bluez-5.76-build/bluez-5.76/src/shared/vcp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def354]
bluez-5.76-build/bluez-5.76/src/shared/vcp.c: scope_hint: In function 'vcp_get_session.part.0'
bluez-5.76-build/bluez-5.76/src/shared/vcp.c:501:18: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
#  499|   
#  500|   	vcp = bt_vcp_new(db, NULL);
#  501|-> 	vcp->att = att;
#  502|   
#  503|   	bt_att_register_disconnect(att, vcp_disconnected, vcp, NULL);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def355]
bluez-5.76-build/bluez-5.76/src/shared/vcp.c: scope_hint: In function 'aics_new'
bluez-5.76-build/bluez-5.76/src/shared/vcp.c:1721:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'ip_descr' where non-null expected
bluez-5.76-build/bluez-5.76/src/shared/vcp.c:22: included_from: Included from here.
bluez-5.76-build/bluez-5.76/src/shared/vcp.c:1716:16: note: in expansion of macro 'new0'
<built-in>: note: argument 1 of '__builtin_memset' must be non-null
# 1719|   	aics_gain_settng_prop = new0(struct gain_setting_prop, 1);
# 1720|   	ip_descr = malloc(256);
# 1721|-> 	memset(ip_descr, 0, 256);
# 1722|   
# 1723|   	aics_aud_ip_st->mute = AICS_NOT_MUTED;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def356]
bluez-5.76-build/bluez-5.76/src/shared/vcp.c: scope_hint: In function 'vcp_audio_loc_notify'
bluez-5.76-build/bluez-5.76/src/shared/vcp.c:1969:27: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'vocs_audio_loc_n'
# 1967|   {
# 1968|   	uint32_t *vocs_audio_loc_n = malloc(sizeof(uint32_t));
# 1969|-> 	*vocs_audio_loc_n = 0;
# 1970|   
# 1971|   	if (value != NULL)

Error: GCC_ANALYZER_WARNING (CWE-688): [#def357]
bluez-5.76-build/bluez-5.76/src/shared/vcp.c: scope_hint: In function 'read_vocs_audio_descriptor.part.0'
bluez-5.76-build/bluez-5.76/src/shared/vcp.c:2131:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'vocs_ao_dec_r' where non-null expected
<built-in>: note: argument 1 of '__builtin_memset' must be non-null
# 2129|   
# 2130|   	vocs_ao_dec_r = malloc(length+1);
# 2131|-> 	memset(vocs_ao_dec_r, 0, length+1);
# 2132|   	memcpy(vocs_ao_dec_r, value, length);
# 2133|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def358]
bluez-5.76-build/bluez-5.76/src/shared/vcp.c: scope_hint: In function 'read_aics_audio_ip_description.part.0'
bluez-5.76-build/bluez-5.76/src/shared/vcp.c:2535:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'ip_descrptn' where non-null expected
<built-in>: note: argument 1 of '__builtin_memset' must be non-null
# 2533|   
# 2534|   	ip_descrptn = malloc(length+1);
# 2535|-> 	memset(ip_descrptn, 0, length+1);
# 2536|   	memcpy(ip_descrptn, value, length);
# 2537|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def359]
bluez-5.76-build/bluez-5.76/src/shared/vcp.c: scope_hint: In function 'aics_audio_ip_desr_notify'
bluez-5.76-build/bluez-5.76/src/shared/vcp.c:2555:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'aud_ip_desr' where non-null expected
<built-in>: note: argument 1 of '__builtin_memset' must be non-null
# 2553|   
# 2554|   	aud_ip_desr = malloc(length+1);
# 2555|-> 	memset(aud_ip_desr, 0, length+1);
# 2556|   	memcpy(aud_ip_desr, value, length);
# 2557|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def360]
bluez-5.76-build/bluez-5.76/src/shared/vcp.c: scope_hint: In function 'foreach_vcs_service'
bluez-5.76-build/bluez-5.76/src/shared/vcp.c:2691:22: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
# 2689|   	struct bt_vcs *vcs = vcp_get_vcs(vcp);
# 2690|   
# 2691|-> 	vcs->service = attr;
# 2692|   
# 2693|   	gatt_db_service_set_claimed(attr, true);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def361]
bluez-5.76-build/bluez-5.76/src/shared/vcp.c: scope_hint: In function 'foreach_vocs_service'
bluez-5.76-build/bluez-5.76/src/shared/vcp.c:2704:23: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
# 2702|   	struct bt_vocs *vocs = vcp_get_vocs(vcp);
# 2703|   
# 2704|-> 	vocs->service = attr;
# 2705|   
# 2706|   	gatt_db_service_set_claimed(attr, true);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def362]
bluez-5.76-build/bluez-5.76/src/shared/vcp.c: scope_hint: In function 'foreach_aics_service'
bluez-5.76-build/bluez-5.76/src/shared/vcp.c:2717:23: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
# 2715|   	struct bt_aics *aics = vcp_get_aics(vcp);
# 2716|   
# 2717|-> 	aics->service = attr;
# 2718|   
# 2719|   	gatt_db_service_set_claimed(attr, true);

Error: CPPCHECK_WARNING: [#def363]
bluez-5.76-build/bluez-5.76/tools/advtest.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def364]
bluez-5.76-build/bluez-5.76/tools/amptest.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-666): [#def365]
bluez-5.76-build/bluez-5.76/tools/avinfo.c: scope_hint: In function ‘l2cap_connect’
bluez-5.76-build/bluez-5.76/tools/avinfo.c:880:13: warning[-Wanalyzer-fd-phase-mismatch]: ‘connect’ on file descriptor ‘sk’ in wrong phase
#  878|   	l2a.l2_psm = htobs(AVDTP_PSM);
#  879|   
#  880|-> 	if (connect(sk, (struct sockaddr *) &l2a, sizeof(l2a)) < 0) {
#  881|   		printf("Connect failed. %s(%d)\n", strerror(errno), errno);
#  882|   		close(sk);

Error: CLANG_WARNING: [#def366]
bluez-5.76-build/bluez-5.76/tools/avtest.c:225:5: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  223|   				buf[2] = 0x29; /* Unsupported configuration */
#  224|   				printf("Rejecting discover command\n");
#  225|-> 				len = write(sk, buf, 3);
#  226|   			} else {
#  227|   				struct seid_info *sei = (void *) (buf + 2);

Error: CLANG_WARNING: [#def367]
bluez-5.76-build/bluez-5.76/tools/avtest.c:235:5: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  233|   				sei->media_type = AVDTP_MEDIA_TYPE_AUDIO;
#  234|   				printf("Accepting discover command\n");
#  235|-> 				len = write(sk, buf, 4);
#  236|   			}
#  237|   			break;

Error: CLANG_WARNING: [#def368]
bluez-5.76-build/bluez-5.76/tools/avtest.c:244:5: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  242|   				buf[2] = 0x29; /* Unsupported configuration */
#  243|   				printf("Rejecting get capabilties command\n");
#  244|-> 				len = write(sk, buf, 3);
#  245|   			} else if (fragment) {
#  246|   				struct avdtp_start_header *start = (void *) buf;

Error: CLANG_WARNING: [#def369]
bluez-5.76-build/bluez-5.76/tools/avtest.c:258:5: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  256|   				memcpy(&buf[3], media_transport,
#  257|   						sizeof(media_transport));
#  258|-> 				len = write(sk, buf,
#  259|   						3 + sizeof(media_transport));
#  260|   

Error: CLANG_WARNING: [#def370]
bluez-5.76-build/bluez-5.76/tools/avtest.c:265:5: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  263|   				memcpy(&buf[1], media_transport,
#  264|   						sizeof(media_transport));
#  265|-> 				len = write(sk, buf,
#  266|   						1 + sizeof(media_transport));
#  267|   

Error: CLANG_WARNING: [#def371]
bluez-5.76-build/bluez-5.76/tools/avtest.c:272:5: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  270|   				memcpy(&buf[1], media_transport,
#  271|   						sizeof(media_transport));
#  272|-> 				len = write(sk, buf,
#  273|   						1 + sizeof(media_transport));
#  274|   			} else {

Error: CLANG_WARNING: [#def372]
bluez-5.76-build/bluez-5.76/tools/avtest.c:279:5: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  277|   						sizeof(media_transport));
#  278|   				printf("Accepting get capabilities command\n");
#  279|-> 				len = write(sk, buf,
#  280|   						2 + sizeof(media_transport));
#  281|   			}

Error: CLANG_WARNING: [#def373]
bluez-5.76-build/bluez-5.76/tools/avtest.c:291:5: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  289|   							0x13; /* SEP In Use */
#  290|   				printf("Rejecting set configuration command\n");
#  291|-> 				len = write(sk, buf, 4);
#  292|   			} else {
#  293|   				hdr->message_type = AVDTP_MSG_TYPE_ACCEPT;

Error: CLANG_WARNING: [#def374]
bluez-5.76-build/bluez-5.76/tools/avtest.c:295:5: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  293|   				hdr->message_type = AVDTP_MSG_TYPE_ACCEPT;
#  294|   				printf("Accepting set configuration command\n");
#  295|-> 				len = write(sk, buf, 2);
#  296|   			}
#  297|   			break;

Error: CLANG_WARNING: [#def375]
bluez-5.76-build/bluez-5.76/tools/avtest.c:304:5: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  302|   				buf[2] = 0x12; /* Bad ACP SEID */
#  303|   				printf("Rejecting get configuration command\n");
#  304|-> 				len = write(sk, buf, 3);
#  305|   			} else {
#  306|   				hdr->message_type = AVDTP_MSG_TYPE_ACCEPT;

Error: CLANG_WARNING: [#def376]
bluez-5.76-build/bluez-5.76/tools/avtest.c:308:5: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  306|   				hdr->message_type = AVDTP_MSG_TYPE_ACCEPT;
#  307|   				printf("Accepting get configuration command\n");
#  308|-> 				len = write(sk, buf, 2);
#  309|   			}
#  310|   			break;

Error: CLANG_WARNING: [#def377]
bluez-5.76-build/bluez-5.76/tools/avtest.c:317:5: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  315|   				buf[2] = 0x31; /* Bad State */
#  316|   				printf("Rejecting open command\n");
#  317|-> 				len = write(sk, buf, 3);
#  318|   			} else {
#  319|   				struct sockaddr_l2 addr;

Error: CLANG_WARNING: [#def378]
bluez-5.76-build/bluez-5.76/tools/avtest.c:324:5: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  322|   				hdr->message_type = AVDTP_MSG_TYPE_ACCEPT;
#  323|   				printf("Accepting open command\n");
#  324|-> 				len = write(sk, buf, 2);
#  325|   
#  326|   				memset(&addr, 0, sizeof(addr));

Error: CLANG_WARNING: [#def379]
bluez-5.76-build/bluez-5.76/tools/avtest.c:346:5: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  344|   				buf[3] = 0x31; /* Bad State */
#  345|   				printf("Rejecting start command\n");
#  346|-> 				len = write(sk, buf, 4);
#  347|   			} else {
#  348|   				hdr->message_type = AVDTP_MSG_TYPE_ACCEPT;

Error: CLANG_WARNING: [#def380]
bluez-5.76-build/bluez-5.76/tools/avtest.c:350:5: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  348|   				hdr->message_type = AVDTP_MSG_TYPE_ACCEPT;
#  349|   				printf("Accepting start command\n");
#  350|-> 				len = write(sk, buf, 2);
#  351|   			}
#  352|   			break;

Error: CLANG_WARNING: [#def381]
bluez-5.76-build/bluez-5.76/tools/avtest.c:359:5: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  357|   				buf[2] = 0x31; /* Bad State */
#  358|   				printf("Rejecting close command\n");
#  359|-> 				len = write(sk, buf, 3);
#  360|   			} else {
#  361|   				hdr->message_type = AVDTP_MSG_TYPE_ACCEPT;

Error: CLANG_WARNING: [#def382]
bluez-5.76-build/bluez-5.76/tools/avtest.c:363:5: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  361|   				hdr->message_type = AVDTP_MSG_TYPE_ACCEPT;
#  362|   				printf("Accepting close command\n");
#  363|-> 				len = write(sk, buf, 2);
#  364|   				if (media_sock >= 0) {
#  365|   					close(media_sock);

Error: CLANG_WARNING: [#def383]
bluez-5.76-build/bluez-5.76/tools/avtest.c:376:5: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  374|   				buf[3] = 0x31; /* Bad State */
#  375|   				printf("Rejecting suspend command\n");
#  376|-> 				len = write(sk, buf, 4);
#  377|   			} else {
#  378|   				hdr->message_type = AVDTP_MSG_TYPE_ACCEPT;

Error: CLANG_WARNING: [#def384]
bluez-5.76-build/bluez-5.76/tools/avtest.c:380:5: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  378|   				hdr->message_type = AVDTP_MSG_TYPE_ACCEPT;
#  379|   				printf("Accepting suspend command\n");
#  380|-> 				len = write(sk, buf, 2);
#  381|   			}
#  382|   			break;

Error: CLANG_WARNING: [#def385]
bluez-5.76-build/bluez-5.76/tools/avtest.c:387:4: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  385|   			hdr->message_type = AVDTP_MSG_TYPE_ACCEPT;
#  386|   			printf("Accepting abort command\n");
#  387|-> 			len = write(sk, buf, 2);
#  388|   			if (media_sock >= 0) {
#  389|   				close(media_sock);

Error: CLANG_WARNING: [#def386]
bluez-5.76-build/bluez-5.76/tools/avtest.c:397:4: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  395|   			buf[1] = 0x00;
#  396|   			printf("Unknown command\n");
#  397|-> 			len = write(sk, buf, 2);
#  398|   			break;
#  399|   		}

Error: GCC_ANALYZER_WARNING (CWE-666): [#def387]
bluez-5.76-build/bluez-5.76/tools/avtest.c: scope_hint: In function ‘do_connect’
bluez-5.76-build/bluez-5.76/tools/avtest.c:532:15: warning[-Wanalyzer-fd-phase-mismatch]: ‘connect’ on file descriptor ‘sk’ in wrong phase
#  530|   	addr.l2_psm = htobs(avctp ? 23 : 25);
#  531|   
#  532|-> 	err = connect(sk, (struct sockaddr *) &addr, sizeof(addr));
#  533|   	if (err < 0) {
#  534|   		perror("Unable to connect");

Error: CLANG_WARNING: [#def388]
bluez-5.76-build/bluez-5.76/tools/avtest.c:562:3: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  560|   		hdr->packet_type = AVDTP_PKT_TYPE_SINGLE;
#  561|   		hdr->signal_id = AVDTP_DISCOVER;
#  562|-> 		len = write(sk, buf, 2);
#  563|   		break;
#  564|   

Error: CLANG_WARNING: [#def389]
bluez-5.76-build/bluez-5.76/tools/avtest.c:570:3: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  568|   		hdr->signal_id = AVDTP_GET_CAPABILITIES;
#  569|   		buf[2] = 1 << 2; /* SEID 1 */
#  570|-> 		len = write(sk, buf, invalid ? 2 : 3);
#  571|   		break;
#  572|   

Error: CLANG_WARNING: [#def390]
bluez-5.76-build/bluez-5.76/tools/avtest.c:584:3: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  582|   		if (invalid)
#  583|   			buf[5] = 0x01; /* LOSC != 0 */
#  584|-> 		len = write(sk, buf, 4 + sizeof(media_transport));
#  585|   		break;
#  586|   

Error: CLANG_WARNING: [#def391]
bluez-5.76-build/bluez-5.76/tools/avtest.c:597:3: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  595|   		else
#  596|   			buf[2] = 1 << 2; /* Valid ACP SEID */
#  597|-> 		len = write(sk, buf, 3);
#  598|   		break;
#  599|   

Error: CLANG_WARNING: [#def392]
bluez-5.76-build/bluez-5.76/tools/avtest.c:607:3: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  605|   		hdr->signal_id = AVDTP_OPEN;
#  606|   		buf[2] = 1 << 2; /* ACP SEID */
#  607|-> 		len = write(sk, buf, 3);
#  608|   		break;
#  609|   

Error: CLANG_WARNING: [#def393]
bluez-5.76-build/bluez-5.76/tools/avtest.c:619:3: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  617|   		hdr->signal_id = AVDTP_START;
#  618|   		buf[2] = 1 << 2; /* ACP SEID */
#  619|-> 		len = write(sk, buf, 3);
#  620|   		break;
#  621|   

Error: CLANG_WARNING: [#def394]
bluez-5.76-build/bluez-5.76/tools/avtest.c:634:3: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  632|   		else
#  633|   			buf[2] = 1 << 2; /* Valid ACP SEID */
#  634|-> 		len = write(sk, buf, 3);
#  635|   		break;
#  636|   

Error: CLANG_WARNING: [#def395]
bluez-5.76-build/bluez-5.76/tools/avtest.c:646:3: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  644|   		hdr->signal_id = AVDTP_SUSPEND;
#  645|   		buf[2] = 1 << 2; /* ACP SEID */
#  646|-> 		len = write(sk, buf, 3);
#  647|   		break;
#  648|   

Error: CLANG_WARNING: [#def396]
bluez-5.76-build/bluez-5.76/tools/avtest.c:655:3: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  653|   		hdr->signal_id = AVDTP_ABORT;
#  654|   		buf[2] = 1 << 2; /* ACP SEID */
#  655|-> 		len = write(sk, buf, 3);
#  656|   		break;
#  657|   

Error: CLANG_WARNING: [#def397]
bluez-5.76-build/bluez-5.76/tools/avtest.c:662:3: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  660|   		hdr->packet_type = AVDTP_PKT_TYPE_SINGLE;
#  661|   		hdr->signal_id = cmd;
#  662|-> 		len = write(sk, buf, 2);
#  663|   		break;
#  664|   	}

Error: CLANG_WARNING: [#def398]
bluez-5.76-build/bluez-5.76/tools/avtest.c:698:2: warning[deadcode.DeadStores]: Value stored to 'len' is never read
#  696|   	memcpy(&buf[AVCTP_HEADER_LENGTH], play_pressed, sizeof(play_pressed));
#  697|   
#  698|-> 	len = write(sk, buf, AVCTP_HEADER_LENGTH + sizeof(play_pressed));
#  699|   
#  700|   	len = read(sk, buf, sizeof(buf));

Error: CPPCHECK_WARNING: [#def399]
bluez-5.76-build/bluez-5.76/tools/bdaddr.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def400]
bluez-5.76-build/bluez-5.76/tools/bluemoon.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-479): [#def401]
bluez-5.76-build/bluez-5.76/tools/bneptest.c: scope_hint: In function ‘exit_handler’
bluez-5.76-build/bluez-5.76/tools/bneptest.c:483:9: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘printf’ from within signal handler
bluez-5.76-build/bluez-5.76/tools/bneptest.c:35: included_from: Included from here.
bluez-5.76-build/bluez-5.76/src/log.h:60:9: note: in expansion of macro ‘DBG_IDX’
bluez-5.76-build/bluez-5.76/tools/bneptest.c:555:9: note: in expansion of macro ‘DBG’
#  481|   static void exit_handler(int sig)
#  482|   {
#  483|-> 	printf("got sig = %d, cleaning up...\n", sig);
#  484|   
#  485|   	if (cleanup() < 0)

Error: GCC_ANALYZER_WARNING (CWE-479): [#def402]
bluez-5.76-build/bluez-5.76/tools/bneptest.c:490:9: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘exit’ from within signal handler
bluez-5.76-build/bluez-5.76/src/log.h:60:9: note: in expansion of macro ‘DBG_IDX’
bluez-5.76-build/bluez-5.76/tools/bneptest.c:555:9: note: in expansion of macro ‘DBG’
bluez-5.76-build/bluez-5.76/tools/bneptest.c:490:9: note: ‘_exit’ is a possible signal-safe alternative for ‘exit’
#  488|   		printf("cleanup successful - exit\n");
#  489|   
#  490|-> 	exit(0);
#  491|   }
#  492|   

Error: CPPCHECK_WARNING: [#def403]
bluez-5.76-build/bluez-5.76/tools/btattach.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def404]
bluez-5.76-build/bluez-5.76/tools/btgatt-client.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def405]
bluez-5.76-build/bluez-5.76/tools/btgatt-client.c:1824:2: warning[deadcode.DeadStores]: Value stored to 'argv' is never read
# 1822|   
# 1823|   	argc -= optind;
# 1824|-> 	argv += optind;
# 1825|   	optind = 0;
# 1826|   

Error: CPPCHECK_WARNING: [#def406]
bluez-5.76-build/bluez-5.76/tools/btgatt-server.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def407]
bluez-5.76-build/bluez-5.76/tools/btgatt-server.c:1212:2: warning[deadcode.DeadStores]: Value stored to 'argv' is never read
# 1210|   
# 1211|   	argc -= optind;
# 1212|-> 	argv -= optind;
# 1213|   	optind = 0;
# 1214|   

Error: CPPCHECK_WARNING: [#def408]
bluez-5.76-build/bluez-5.76/tools/btinfo.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def409]
bluez-5.76-build/bluez-5.76/tools/btiotest.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def410]
bluez-5.76-build/bluez-5.76/tools/btproxy.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def411]
bluez-5.76-build/bluez-5.76/tools/btsnoop.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-775): [#def412]
bluez-5.76-build/bluez-5.76/tools/btsnoop.c: scope_hint: In function ‘command_merge’
bluez-5.76-build/bluez-5.76/tools/btsnoop.c:260:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor
/usr/include/sys/types.h:176: included_from: Included from here.
/usr/include/stdlib.h:514: included_from: Included from here.
bluez-5.76-build/bluez-5.76/tools/btsnoop.c:21: included_from: Included from here.
#  258|   	for (i = 0; i < num_input; i++)
#  259|   		close(input_fd[i]);
#  260|-> }
#  261|   
#  262|   static void command_extract_eir(const char *input)

Error: CLANG_WARNING: [#def413]
bluez-5.76-build/bluez-5.76/tools/check-selftest.c:42:3: warning[deadcode.DeadStores]: Value stored to 'ptr' is never read
#   40|   		char result[32], *ptr;
#   41|   
#   42|-> 		ptr = fgets(result, sizeof(result), fp);
#   43|   		fclose(fp);
#   44|   

Error: CPPCHECK_WARNING: [#def414]
bluez-5.76-build/bluez-5.76/tools/ciptool.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def415]
bluez-5.76-build/bluez-5.76/tools/ciptool.c:350:7: warning[core.CallAndMessage]: 5th function call argument is an uninitialized value
#  348|   		psm = atoi(argv[2]);
#  349|   
#  350|-> 	sk = do_connect(ctl, dev_id, &src, &dst, psm, (1 << CMTP_LOOPBACK));
#  351|   
#  352|   	printf("Press CTRL-C for hangup\n");

Error: GCC_ANALYZER_WARNING (CWE-666): [#def416]
bluez-5.76-build/bluez-5.76/tools/cltest.c: scope_hint: In function ‘send_message’
bluez-5.76-build/bluez-5.76/tools/cltest.c:62:13: warning[-Wanalyzer-fd-phase-mismatch]: ‘connect’ on file descriptor ‘fd’ in wrong phase
bluez-5.76-build/bluez-5.76/tools/cltest.c:26: included_from: Included from here.
bluez-5.76-build/bluez-5.76/tools/cltest.c:249:33: note: in expansion of macro ‘BDADDR_ANY’
bluez-5.76-build/bluez-5.76/tools/cltest.c:250:53: note: in expansion of macro ‘BDADDR_ANY’
#   60|   	addr.l2_psm = htobs(psm);
#   61|   
#   62|-> 	if (connect(fd, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
#   63|   		perror("Failed to connect transmitter socket");
#   64|   		close(fd);

Error: CLANG_WARNING: [#def417]
bluez-5.76-build/bluez-5.76/tools/create-image.c:76:3: warning[deadcode.DeadStores]: Value stored to 'fd' is never read
#   74|   
#   75|   	if (!pathname) {
#   76|-> 		fd = -1;
#   77|   		map = NULL;
#   78|   		st.st_size = 0;

Error: CLANG_WARNING: [#def418]
bluez-5.76-build/bluez-5.76/tools/create-image.c:84:3: warning[deadcode.DeadStores]: Value stored to 'fd' is never read
#   82|   	fd = open(pathname, O_RDONLY | O_CLOEXEC);
#   83|   	if (fd < 0) {
#   84|-> 		fd = -1;
#   85|   		map = NULL;
#   86|   		st.st_size = 0;

Error: CLANG_WARNING: [#def419]
bluez-5.76-build/bluez-5.76/tools/create-image.c:92:3: warning[deadcode.DeadStores]: Value stored to 'fd' is never read
#   90|   	if (fstat(fd, &st) < 0) {
#   91|   		close(fd);
#   92|-> 		fd = -1;
#   93|   		map = NULL;
#   94|   		st.st_size = 0;

Error: CLANG_WARNING: [#def420]
bluez-5.76-build/bluez-5.76/tools/create-image.c:105:2: warning[deadcode.DeadStores]: Value stored to 'fd' is never read
#  103|   
#  104|   	close(fd);
#  105|-> 	fd = -1;
#  106|   
#  107|   done:

Error: GCC_ANALYZER_WARNING (CWE-688): [#def421]
bluez-5.76-build/bluez-5.76/tools/create-image.c: scope_hint: In function ‘write_block’
bluez-5.76-build/bluez-5.76/tools/create-image.c:108:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fp’ where non-null expected
bluez-5.76-build/bluez-5.76/tools/create-image.c:16: included_from: Included from here.
/usr/include/stdio.h:357:12: note: argument 1 of ‘fprintf’ must be non-null
#  106|   
#  107|   done:
#  108|-> 	fprintf(fp, HDR_FMT, HDR_MAGIC, ino, mode, 0, 0, 1, 0,
#  109|   		(uintmax_t) st.st_size, 0, 0, 0, 0, namelen + 1, 0, name);
#  110|   

Error: CLANG_WARNING: [#def422]
bluez-5.76-build/bluez-5.76/tools/gatt-service.c:294:2: warning[core.CallAndMessage]: 2nd function call argument is an uninitialized value
#  292|   	}
#  293|   
#  294|-> 	chr_write(chr, value, len);
#  295|   
#  296|   	g_dbus_pending_property_success(id);

Error: CPPCHECK_WARNING: [#def423]
bluez-5.76-build/bluez-5.76/tools/hci-tester.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-457): [#def424]
bluez-5.76-build/bluez-5.76/tools/hci-tester.c:393: error[uninitvar]: Uninitialized variable: &cmd
#  391|   	util_hexdump('<', cmd.plaintext, 16, test_debug, NULL);
#  392|   
#  393|-> 	if (!bt_hci_send(user->hci_ut, BT_HCI_CMD_LE_ENCRYPT, &cmd, sizeof(cmd),
#  394|   					test_le_encrypt_complete, NULL, NULL)) {
#  395|   		tester_warn("Failed to send HCI LE Encrypt command");

Error: CPPCHECK_WARNING: [#def425]
bluez-5.76-build/bluez-5.76/tools/hciattach.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def426]
bluez-5.76-build/bluez-5.76/tools/hciattach.c:816:7: warning[deadcode.DeadStores]: Although the value stored to 'n' is used in the enclosing expression, the value is never actually read from 'n'
#  814|   
#  815|   	/* Read reply */
#  816|-> 	if ((n = read_hci_event(fd, resp, 10)) < 0) {
#  817|   		fprintf(stderr, "Failed to set baud rate on chip\n");
#  818|   		return -1;

Error: CLANG_WARNING: [#def427]
bluez-5.76-build/bluez-5.76/tools/hciattach.c:864:7: warning[deadcode.DeadStores]: Although the value stored to 'n' is used in the enclosing expression, the value is never actually read from 'n'
#  862|   
#  863|   	/* Read reply */
#  864|-> 	if ((n = read_hci_event(fd, resp, 4)) < 0) {
#  865|   		fprintf(stderr, "Failed to reset chip\n");
#  866|   		return -1;

Error: CLANG_WARNING: [#def428]
bluez-5.76-build/bluez-5.76/tools/hciattach.c:886:8: warning[deadcode.DeadStores]: Although the value stored to 'n' is used in the enclosing expression, the value is never actually read from 'n'
#  884|   
#  885|   		/* Read reply */
#  886|-> 		if ((n = read_hci_event(fd, resp, 10)) < 0) {
#  887|   			fprintf(stderr, "Failed to set BD_ADDR\n");
#  888|   			return -1;

Error: CLANG_WARNING: [#def429]
bluez-5.76-build/bluez-5.76/tools/hciattach.c:908:7: warning[deadcode.DeadStores]: Although the value stored to 'n' is used in the enclosing expression, the value is never actually read from 'n'
#  906|   
#  907|   	/* Read reply */
#  908|-> 	if ((n = read_hci_event(fd, resp, 4)) < 0) {
#  909|   		fprintf(stderr, "Failed to read local version\n");
#  910|   		return -1;

Error: CLANG_WARNING: [#def430]
bluez-5.76-build/bluez-5.76/tools/hciattach.c:929:7: warning[deadcode.DeadStores]: Although the value stored to 'n' is used in the enclosing expression, the value is never actually read from 'n'
#  927|   
#  928|   	/* Read reply */
#  929|-> 	if ((n = read_hci_event(fd, resp, 4)) < 0) {
#  930|   		fprintf(stderr, "Failed to read local supported commands\n");
#  931|   		return -1;

Error: CLANG_WARNING: [#def431]
bluez-5.76-build/bluez-5.76/tools/hciattach.c:973:7: warning[deadcode.DeadStores]: Although the value stored to 'n' is used in the enclosing expression, the value is never actually read from 'n'
#  971|   	}
#  972|   
#  973|-> 	if ((n = read_hci_event(fd, resp, 6)) < 0) {
#  974|   		fprintf(stderr, "Failed to set baud rate\n");
#  975|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def432]
bluez-5.76-build/bluez-5.76/tools/hciattach.c: scope_hint: In function ‘main’
bluez-5.76-build/bluez-5.76/tools/hciattach.c:1321:34: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘u’
# 1319|   
# 1320|   		case 2:
# 1321|-> 			u->speed = atoi(argv[optind]);
# 1322|   			break;
# 1323|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def433]
bluez-5.76-build/bluez-5.76/tools/hciattach.c:1326:34: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘u’
# 1324|   		case 3:
# 1325|   			if (!strcmp("flow", argv[optind]))
# 1326|-> 				u->flags |=  FLOW_CTL;
# 1327|   			else
# 1328|   				u->flags &= ~FLOW_CTL;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def434]
bluez-5.76-build/bluez-5.76/tools/hciattach.c:1328:34: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘u’
# 1326|   				u->flags |=  FLOW_CTL;
# 1327|   			else
# 1328|-> 				u->flags &= ~FLOW_CTL;
# 1329|   			break;
# 1330|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def435]
bluez-5.76-build/bluez-5.76/tools/hciattach.c:1333:39: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘u’
# 1331|   		case 4:
# 1332|   			if (!strcmp("sleep", argv[optind]))
# 1333|-> 				u->pm = ENABLE_PM;
# 1334|   			else
# 1335|   				u->pm = DISABLE_PM;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def436]
bluez-5.76-build/bluez-5.76/tools/hciattach.c:1335:39: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘u’
# 1333|   				u->pm = ENABLE_PM;
# 1334|   			else
# 1335|-> 				u->pm = DISABLE_PM;
# 1336|   			break;
# 1337|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def437]
bluez-5.76-build/bluez-5.76/tools/hciattach.c:1339:35: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘u’
# 1337|   
# 1338|   		case 5:
# 1339|-> 			u->bdaddr = argv[optind];
# 1340|   			break;
# 1341|   		}

Error: CPPCHECK_WARNING: [#def438]
bluez-5.76-build/bluez-5.76/tools/hciattach_ath3k.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def439]
bluez-5.76-build/bluez-5.76/tools/hciattach_bcm43xx.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def440]
bluez-5.76-build/bluez-5.76/tools/hciattach_intel.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def441]
bluez-5.76-build/bluez-5.76/tools/hciattach_qualcomm.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-775): [#def442]
bluez-5.76-build/bluez-5.76/tools/hciattach_qualcomm.c: scope_hint: In function ‘qualcomm_load_firmware’
bluez-5.76-build/bluez-5.76/tools/hciattach_qualcomm.c:93:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(firmware, 0)’
bluez-5.76-build/bluez-5.76/tools/hciattach_qualcomm.c:95:9: note: in expansion of macro ‘FAILIF’
bluez-5.76-build/bluez-5.76/tools/hciattach_qualcomm.c:95:9: note: in expansion of macro ‘FAILIF’
bluez-5.76-build/bluez-5.76/tools/hciattach_qualcomm.c:111:17: note: in expansion of macro ‘FAILIF’
#   91|   	int fw = open(firmware, O_RDONLY);
#   92|   
#   93|-> 	fprintf(stdout, "Opening firmware file: %s\n", firmware);
#   94|   
#   95|   	FAILIF(fw < 0,

Error: CPPCHECK_WARNING: [#def443]
bluez-5.76-build/bluez-5.76/tools/hciattach_st.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def444]
bluez-5.76-build/bluez-5.76/tools/hciattach_ti.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def445]
bluez-5.76-build/bluez-5.76/tools/hciattach_tialt.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-775): [#def446]
bluez-5.76-build/bluez-5.76/tools/hciattach_tialt.c: scope_hint: In function ‘texas_load_firmware’
bluez-5.76-build/bluez-5.76/tools/hciattach_tialt.c:95:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(firmware, 0)’
bluez-5.76-build/bluez-5.76/tools/hciattach_tialt.c:97:9: note: in expansion of macro ‘FAILIF’
bluez-5.76-build/bluez-5.76/tools/hciattach_tialt.c:97:9: note: in expansion of macro ‘FAILIF’
bluez-5.76-build/bluez-5.76/tools/hciattach_tialt.c:111:17: note: in expansion of macro ‘FAILIF’
#   93|   	int fw = open(firmware, O_RDONLY);
#   94|   
#   95|-> 	fprintf(stdout, "Opening firmware file: %s\n", firmware);
#   96|   
#   97|   	FAILIF(fw < 0,

Error: CPPCHECK_WARNING: [#def447]
bluez-5.76-build/bluez-5.76/tools/hciconfig.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def448]
bluez-5.76-build/bluez-5.76/tools/hcidump.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-401): [#def449]
bluez-5.76-build/bluez-5.76/tools/hcidump.c: scope_hint: In function ‘process_frames’
bluez-5.76-build/bluez-5.76/tools/hcidump.c:141:24: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
#  139|   
#  140|   	if (sock < 0)
#  141|-> 		return -1;
#  142|   
#  143|   	if (snap_len < SNAP_LEN)

Error: CLANG_WARNING: [#def450]
bluez-5.76-build/bluez-5.76/tools/hcidump.c:180:9: warning[unix.Malloc]: Potential leak of memory pointed to by 'dp'
#  178|   		for (i = 0; i < nfds; i++) {
#  179|   			if (fds[i].revents & (POLLHUP | POLLERR | POLLNVAL)) {
#  180|-> 				if (fds[i].fd == sock)
#  181|   					printf("device: disconnected\n");
#  182|   				else

Error: CLANG_WARNING: [#def451]
bluez-5.76-build/bluez-5.76/tools/hcidump.c:248:17: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
#  246|   				dh->len = htobs(frm.data_len);
#  247|   				dh->in  = frm.in;
#  248|-> 				dh->ts_sec  = htobl(frm.ts.tv_sec);
#  249|   				dh->ts_usec = htobl(frm.ts.tv_usec);
#  250|   			}

Error: CLANG_WARNING: [#def452]
bluez-5.76-build/bluez-5.76/tools/hcidump.c:326:9: warning[core.CallAndMessage]: 1st function call argument is an uninitialized value
#  324|   			switch (btsnoop_type) {
#  325|   			case 1001:
#  326|-> 				if (be32toh(dp.flags) & 0x02) {
#  327|   					if (be32toh(dp.flags) & 0x01)
#  328|   						pkt_type = HCI_EVENT_PKT;

Error: CLANG_WARNING: [#def453]
bluez-5.76-build/bluez-5.76/tools/hcidump.c:341:20: warning[core.CallAndMessage]: 1st function call argument is an uninitialized value
#  339|   
#  340|   			case 1002:
#  341|-> 				frm.data_len = be32toh(dp.len);
#  342|   				err = read_n(fd, frm.data, frm.data_len);
#  343|   				break;

Error: CLANG_WARNING: [#def454]
bluez-5.76-build/bluez-5.76/tools/hcidump.c:346:14: warning[core.CallAndMessage]: 1st function call argument is an uninitialized value
#  344|   
#  345|   			case 2001:
#  346|-> 				opcode = be32toh(dp.flags) & 0xffff;
#  347|   
#  348|   				switch (opcode) {

Error: CLANG_WARNING: [#def455]
bluez-5.76-build/bluez-5.76/tools/hcidump.c:384:17: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
#  382|   			}
#  383|   		} else {
#  384|-> 			frm.data_len = btohs(dh.len);
#  385|   			err = read_n(fd, frm.data, frm.data_len);
#  386|   		}

Error: CLANG_WARNING: [#def456]
bluez-5.76-build/bluez-5.76/tools/hcidump.c:394:11: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
#  392|   
#  393|   		frm.ptr = frm.data;
#  394|-> 		frm.len = frm.data_len;
#  395|   
#  396|   		if (parser.flags & DUMP_PKTLOG) {

Error: CLANG_WARNING: [#def457]
bluez-5.76-build/bluez-5.76/tools/hcidump.c:398:9: warning[core.CallAndMessage]: 1st function call argument is an uninitialized value
#  396|   		if (parser.flags & DUMP_PKTLOG) {
#  397|   			uint64_t ts;
#  398|-> 			ts = be64toh(ph.ts);
#  399|   			frm.ts.tv_sec = ts >> 32;
#  400|   			frm.ts.tv_usec = ts & 0xffffffff;

Error: CLANG_WARNING: [#def458]
bluez-5.76-build/bluez-5.76/tools/hcidump.c:403:13: warning[core.CallAndMessage]: 1st function call argument is an uninitialized value
#  401|   		} else if (parser.flags & DUMP_BTSNOOP) {
#  402|   			uint64_t ts;
#  403|-> 			frm.in = be32toh(dp.flags) & 0x01;
#  404|   			ts = be64toh(dp.ts) - 0x00E03AB44A676000ll;
#  405|   			frm.ts.tv_sec = (ts / 1000000ll) + 946684800ll;

Error: CLANG_WARNING: [#def459]
bluez-5.76-build/bluez-5.76/tools/hcidump.c:408:11: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
#  406|   			frm.ts.tv_usec = ts % 1000000ll;
#  407|   		} else {
#  408|-> 			frm.in = dh.in;
#  409|   			frm.ts.tv_sec  = btohl(dh.ts_sec);
#  410|   			frm.ts.tv_usec = btohl(dh.ts_usec);

Error: CLANG_WARNING: [#def460]
bluez-5.76-build/bluez-5.76/tools/hcidump.c:437:7: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
#  435|   		open_flags = O_RDONLY;
#  436|   
#  437|-> 	fd = open(file, open_flags, 0644);
#  438|   	if (fd < 0) {
#  439|   		perror("Can't open dump file");

Error: CPPCHECK_WARNING: [#def461]
bluez-5.76-build/bluez-5.76/tools/hcieventmask.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def462]
bluez-5.76-build/bluez-5.76/tools/hcitool.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def463]
bluez-5.76-build/bluez-5.76/tools/hex2hcd.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def464]
bluez-5.76-build/bluez-5.76/tools/iso-tester.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def465]
bluez-5.76-build/bluez-5.76/tools/iso-tester.c: scope_hint: In function ‘listen_iso_sock’
bluez-5.76-build/bluez-5.76/tools/iso-tester.c:2791:26: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘addr’
# 2789|   	addr = malloc(sizeof(*addr) + sizeof(*addr->iso_bc));
# 2790|   	memset(addr, 0, sizeof(*addr) + sizeof(*addr->iso_bc));
# 2791|-> 	addr->iso_family = AF_BLUETOOTH;
# 2792|   	bacpy(&addr->iso_bdaddr, (void *) src);
# 2793|   	addr->iso_bdaddr_type = BDADDR_LE_PUBLIC;

Error: CPPCHECK_WARNING: [#def466]
bluez-5.76-build/bluez-5.76/tools/isotest.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def467]
bluez-5.76-build/bluez-5.76/tools/isotest.c: scope_hint: In function ‘do_listen’
bluez-5.76-build/bluez-5.76/tools/isotest.c:516:26: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘addr’
bluez-5.76-build/bluez-5.76/tools/isotest.c:17: included_from: Included from here.
#  514|   	addr = malloc(sizeof(*addr) + sizeof(*addr->iso_bc));
#  515|   	memset(addr, 0, sizeof(*addr) + sizeof(*addr->iso_bc));
#  516|-> 	addr->iso_family = AF_BLUETOOTH;
#  517|   	bacpy(&addr->iso_bdaddr, mgmt_index != MGMT_INDEX_NONE ?
#  518|   					&bdaddr : BDADDR_ANY);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def468]
bluez-5.76-build/bluez-5.76/tools/isotest.c: scope_hint: In function ‘main’
bluez-5.76-build/bluez-5.76/tools/isotest.c:1210:18: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘iso_qos’
# 1208|   	iso_qos = malloc(sizeof(*iso_qos));
# 1209|   	/* Default to 16_2_1 */
# 1210|-> 	*iso_qos = presets[3].qos;
# 1211|   	inout = true;
# 1212|   

Error: CPPCHECK_WARNING: [#def469]
bluez-5.76-build/bluez-5.76/tools/l2cap-tester.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-666): [#def470]
bluez-5.76-build/bluez-5.76/tools/l2cap-tester.c: scope_hint: In function ‘connect_l2cap_impl’
bluez-5.76-build/bluez-5.76/tools/l2cap-tester.c:1500:15: warning[-Wanalyzer-fd-phase-mismatch]: ‘connect’ on file descriptor ‘sk’ in wrong phase
# 1498|   	addr.l2_cid = htobs(cid);
# 1499|   
# 1500|-> 	err = connect(sk, (struct sockaddr *) &addr, sizeof(addr));
# 1501|   	if (err < 0 && !(errno == EAGAIN || errno == EINPROGRESS)) {
# 1502|   		err = -errno;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def471]
bluez-5.76-build/bluez-5.76/tools/l2cap-tester.c: scope_hint: In function ‘l2cap_listen_cb’
bluez-5.76-build/bluez-5.76/tools/l2cap-tester.c:2170:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘g_io_channel_unix_get_fd(io)’
# 2168|   
# 2169|   	new_sk = accept(sk, NULL, NULL);
# 2170|-> 	if (new_sk < 0) {
# 2171|   		tester_warn("accept failed: %s (%u)", strerror(errno), errno);
# 2172|   		tester_test_failed();

Error: CPPCHECK_WARNING: [#def472]
bluez-5.76-build/bluez-5.76/tools/l2test.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def473]
bluez-5.76-build/bluez-5.76/tools/mesh-cfgclient.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def474]
bluez-5.76-build/bluez-5.76/tools/mesh-cfgtest.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def475]
bluez-5.76-build/bluez-5.76/tools/mesh-gatt/config-client.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def476]
bluez-5.76-build/bluez-5.76/tools/mesh-gatt/crypto.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-457): [#def477]
bluez-5.76-build/bluez-5.76/tools/mesh-gatt/crypto.c: scope_hint: In function ‘mesh_crypto_aes_ccm_encrypt’
bluez-5.76-build/bluez-5.76/tools/mesh-gatt/crypto.c:376:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘&mic’
#  374|   
#  375|   	if (out_msg)
#  376|-> 		memcpy(out_msg + msg_len, mic, mic_size);
#  377|   
#  378|   	if (out_mic) {

Error: CPPCHECK_WARNING: [#def478]
bluez-5.76-build/bluez-5.76/tools/mesh-gatt/gatt.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def479]
bluez-5.76-build/bluez-5.76/tools/mesh-gatt/net.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def480]
bluez-5.76-build/bluez-5.76/tools/mesh-gatt/node.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def481]
bluez-5.76-build/bluez-5.76/tools/mesh-gatt/prov-db.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-775): [#def482]
bluez-5.76-build/bluez-5.76/tools/mesh-gatt/prov-db.c: scope_hint: In function ‘prov_file_read’
bluez-5.76-build/bluez-5.76/tools/mesh-gatt/prov-db.c:56:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(filename, 0)’
#   54|   
#   55|   	fd = open(filename,O_RDONLY);
#   56|-> 	if (!fd)
#   57|   		return NULL;
#   58|   

Error: CPPCHECK_WARNING: [#def483]
bluez-5.76-build/bluez-5.76/tools/mesh-gatt/prov.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def484]
bluez-5.76-build/bluez-5.76/tools/mesh-tester.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-457): [#def485]
bluez-5.76-build/bluez-5.76/tools/mesh/agent.c:94: error[uninitvar]: Uninitialized variable: buf
#   92|   		len = 0;
#   93|   
#   94|-> 	bt_put_be32(atoi(input), buf);
#   95|   
#   96|   	if (pending_request.cb)

Error: CPPCHECK_WARNING: [#def486]
bluez-5.76-build/bluez-5.76/tools/mesh/cfgcli.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def487]
bluez-5.76-build/bluez-5.76/tools/mesh/keys.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def488]
bluez-5.76-build/bluez-5.76/tools/mesh/mesh-db.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def489]
bluez-5.76-build/bluez-5.76/tools/mesh/remote.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def490]
bluez-5.76-build/bluez-5.76/tools/mesh/util.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def491]
bluez-5.76-build/bluez-5.76/tools/meshctl.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def492]
bluez-5.76-build/bluez-5.76/tools/meshctl.c:326:19: warning[core.NullDereference]: Access to field 'mesh_devices' results in a dereference of a null pointer (loaded from variable 'default_ctrl')
#  324|   static void forget_mesh_devices()
#  325|   {
#  326|-> 	g_list_free_full(default_ctrl->mesh_devices, g_free);
#  327|   	default_ctrl->mesh_devices = NULL;
#  328|   }

Error: CPPCHECK_WARNING (CWE-457): [#def493]
bluez-5.76-build/bluez-5.76/tools/meshctl.c:762: warning[uninitvar]: Uninitialized variable: addr
#  760|   			dbus_message_iter_get_basic(&iter, &addr);
#  761|   
#  762|-> 	bt_shell_printf("Attempting to disconnect from %s\n", addr);
#  763|   }
#  764|   

Error: CLANG_WARNING: [#def494]
bluez-5.76-build/bluez-5.76/tools/meshctl.c:762:2: warning[core.CallAndMessage]: 2nd function call argument is an uninitialized value
#  760|   			dbus_message_iter_get_basic(&iter, &addr);
#  761|   
#  762|-> 	bt_shell_printf("Attempting to disconnect from %s\n", addr);
#  763|   }
#  764|   

Error: CLANG_WARNING: [#def495]
bluez-5.76-build/bluez-5.76/tools/meshctl.c:1957:2: warning[deadcode.DeadStores]: Value stored to 'len' is never read
# 1955|   	sprintf(mesh_local_config_filename + len + extra, "%s",
# 1956|   							"local_node.json");
# 1957|-> 	len = len + extra + strlen("local_node.json");
# 1958|   
# 1959|   	if (!prov_db_read_local_node(mesh_local_config_filename, true)) {

Error: CPPCHECK_WARNING: [#def496]
bluez-5.76-build/bluez-5.76/tools/mgmt-tester.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def497]
bluez-5.76-build/bluez-5.76/tools/mpris-proxy.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def498]
/usr/include/glib-2.0/glib/gstring.h:37: included_from: Included from here.
/usr/include/glib-2.0/glib/giochannel.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:56: included_from: Included from here.
bluez-5.76-build/bluez-5.76/tools/mpris-proxy.c:26: included_from: Included from here.
bluez-5.76-build/bluez-5.76/tools/mpris-proxy.c: scope_hint: In function ‘mpris_busname’
bluez-5.76-build/bluez-5.76/tools/mpris-proxy.c:1863:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘name’
/usr/include/glib-2.0/glib/gstrfuncs.h:71:29: note: in definition of macro ‘g_ascii_isdigit’
bluez-5.76-build/bluez-5.76/tools/mpris-proxy.c:1967:27: note: in expansion of macro ‘g_strdup’
bluez-5.76-build/bluez-5.76/tools/mpris-proxy.c:1967:27: note: in expansion of macro ‘g_strdup’
/usr/include/glib-2.0/glib/glist.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib/ghash.h:36: included_from: Included from here.
/usr/include/glib-2.0/glib.h:52: included_from: Included from here.
bluez-5.76-build/bluez-5.76/tools/mpris-proxy.c: scope_hint: In function ‘mpris_busname’
/usr/include/glib-2.0/glib/gmem.h:332:57: note: in expansion of macro ‘_G_NEW’
bluez-5.76-build/bluez-5.76/tools/mpris-proxy.c:1969:18: note: in expansion of macro ‘g_new0’
/usr/include/glib-2.0/glib/gstrfuncs.h:71:29: note: in definition of macro ‘g_ascii_isdigit’
# 1861|   static char *mpris_busname(char *name)
# 1862|   {
# 1863|-> 	if (g_ascii_isdigit(name[0]))
# 1864|   		return g_strconcat(MPRIS_BUS_NAME, "bt_",
# 1865|   				g_strcanon(name, A_Z a_z _0_9, '_'), NULL);

Error: CLANG_WARNING: [#def499]
bluez-5.76-build/bluez-5.76/tools/obex-server-tool.c:133:13: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
#  131|   	data = g_new0(struct transfer_data, 1);
#  132|   
#  133|-> 	data->fd = open(name, O_WRONLY | O_CREAT | O_NOCTTY, 0600);
#  134|   	if (data->fd < 0) {
#  135|   		g_printerr("open(%s): %s\n", name, strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-688): [#def500]
bluez-5.76-build/bluez-5.76/tools/obex-server-tool.c: scope_hint: In function ‘handle_put’
bluez-5.76-build/bluez-5.76/tools/obex-server-tool.c:133:20: warning[-Wanalyzer-null-argument]: use of NULL ‘name’ where non-null expected
bluez-5.76-build/bluez-5.76/tools/obex-server-tool.c:17: included_from: Included from here.
/usr/include/fcntl.h:209:12: note: argument 1 of ‘open’ must be non-null
#  131|   	data = g_new0(struct transfer_data, 1);
#  132|   
#  133|-> 	data->fd = open(name, O_WRONLY | O_CREAT | O_NOCTTY, 0600);
#  134|   	if (data->fd < 0) {
#  135|   		g_printerr("open(%s): %s\n", name, strerror(errno));

Error: CLANG_WARNING: [#def501]
bluez-5.76-build/bluez-5.76/tools/obex-server-tool.c:192:13: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
#  190|   	data = g_new0(struct transfer_data, 1);
#  191|   
#  192|-> 	data->fd = open(name, O_RDONLY | O_NOCTTY, 0);
#  193|   	if (data->fd < 0) {
#  194|   		g_printerr("open(%s): %s\n", name, strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-688): [#def502]
bluez-5.76-build/bluez-5.76/tools/obex-server-tool.c: scope_hint: In function ‘handle_get’
bluez-5.76-build/bluez-5.76/tools/obex-server-tool.c:192:20: warning[-Wanalyzer-null-argument]: use of NULL ‘name’ where non-null expected
/usr/include/fcntl.h:209:12: note: argument 1 of ‘open’ must be non-null
#  190|   	data = g_new0(struct transfer_data, 1);
#  191|   
#  192|-> 	data->fd = open(name, O_RDONLY | O_NOCTTY, 0);
#  193|   	if (data->fd < 0) {
#  194|   		g_printerr("open(%s): %s\n", name, strerror(errno));

Error: CPPCHECK_WARNING: [#def503]
bluez-5.76-build/bluez-5.76/tools/oobtest.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def504]
bluez-5.76-build/bluez-5.76/tools/parser/avdtp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def505]
bluez-5.76-build/bluez-5.76/tools/parser/cmtp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def506]
bluez-5.76-build/bluez-5.76/tools/parser/hci.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def507]
bluez-5.76-build/bluez-5.76/tools/parser/l2cap.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def508]
bluez-5.76-build/bluez-5.76/tools/parser/parser.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def509]
bluez-5.76-build/bluez-5.76/tools/parser/amp.c:15: included_from: Included from here.
bluez-5.76-build/bluez-5.76/tools/parser/parser.h:121:16: warning[core.NullDereference]: Dereference of null pointer
#  119|   			if (parser.flags & DUMP_VERBOSE) {
#  120|   				struct tm tm;
#  121|-> 				time_t t = f->ts.tv_sec;
#  122|   				localtime_r(&t, &tm);
#  123|   				printf("%04d-%02d-%02d %02d:%02d:%02d.%06lu ",

Error: CLANG_WARNING: [#def510]
bluez-5.76-build/bluez-5.76/tools/parser/parser.h:127:27: warning[core.NullDereference]: Dereference of null pointer
#  125|   					tm.tm_hour, tm.tm_min, tm.tm_sec, f->ts.tv_usec);
#  126|   			} else
#  127|-> 				printf("%8lu.%06lu ", f->ts.tv_sec, f->ts.tv_usec);
#  128|   		}
#  129|   		printf("%c ", (f->in ? '>' : '<'));

Error: CLANG_WARNING: [#def511]
bluez-5.76-build/bluez-5.76/tools/parser/parser.h:129:18: warning[core.NullDereference]: Access to field 'in' results in a dereference of a null pointer (loaded from variable 'f')
#  127|   				printf("%8lu.%06lu ", f->ts.tv_sec, f->ts.tv_usec);
#  128|   		}
#  129|-> 		printf("%c ", (f->in ? '>' : '<'));
#  130|   		parser.state = 1;
#  131|   	} else 

Error: GCC_ANALYZER_WARNING (CWE-476): [#def512]
bluez-5.76-build/bluez-5.76/tools/parser/amp.c:15: included_from: Included from here.
bluez-5.76-build/bluez-5.76/tools/parser/parser.h: scope_hint: In function ‘p_indent’
bluez-5.76-build/bluez-5.76/tools/parser/parser.h:129:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘f’
#  127|   				printf("%8lu.%06lu ", f->ts.tv_sec, f->ts.tv_usec);
#  128|   		}
#  129|-> 		printf("%c ", (f->in ? '>' : '<'));
#  130|   		parser.state = 1;
#  131|   	} else 

Error: CLANG_WARNING: [#def513]
bluez-5.76-build/bluez-5.76/tools/parser/ppp.c:22: included_from: Included from here.
bluez-5.76-build/bluez-5.76/tools/parser/parser.h:156:2: warning[core.uninitialized.UndefReturn]: Undefined or garbage value returned to caller
#  154|   	frm->ptr += 1;
#  155|   	frm->len -= 1;
#  156|-> 	return *u8_ptr;
#  157|   }
#  158|   

Error: CPPCHECK_WARNING: [#def514]
bluez-5.76-build/bluez-5.76/tools/parser/ppp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def515]
bluez-5.76-build/bluez-5.76/tools/parser/ppp.c:108:30: warning[core.UndefinedBinaryOperatorResult]: The left operand of '&' is a garbage value
#  106|   				dir2str(frm->in), addr, ctrl, frm->len, fcs);
#  107|   
#  108|-> 	if (*((uint8_t *) frm->ptr) & 0x80)
#  109|   		proto = p_get_u16(frm);
#  110|   	else

Error: CPPCHECK_WARNING: [#def516]
bluez-5.76-build/bluez-5.76/tools/parser/sdp.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def517]
bluez-5.76-build/bluez-5.76/tools/rctest.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def518]
bluez-5.76-build/bluez-5.76/tools/rctest.c: scope_hint: In function ‘do_listen’
bluez-5.76-build/bluez-5.76/tools/rctest.c:436:9: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘sk’
bluez-5.76-build/bluez-5.76/tools/rctest.c:18: included_from: Included from here.
#  434|   
#  435|   error:
#  436|-> 	close(sk);
#  437|   	exit(1);
#  438|   }

Error: GCC_ANALYZER_WARNING: [#def519]
bluez-5.76-build/bluez-5.76/tools/rfcomm-tester.c: scope_hint: In function ‘create_rfcomm_sock’
bluez-5.76-build/bluez-5.76/tools/rfcomm-tester.c:404:13: warning[-Wanalyzer-fd-use-without-check]: ‘bind’ on possibly invalid file descriptor ‘sk’
#  402|   	bacpy(&addr.rc_bdaddr, address);
#  403|   
#  404|-> 	if (bind(sk, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
#  405|   		close(sk);
#  406|   		return -1;

Error: GCC_ANALYZER_WARNING (CWE-666): [#def520]
bluez-5.76-build/bluez-5.76/tools/rfcomm-tester.c: scope_hint: In function ‘connect_rfcomm_sock’
bluez-5.76-build/bluez-5.76/tools/rfcomm-tester.c:422:15: warning[-Wanalyzer-fd-phase-mismatch]: ‘connect’ on file descriptor ‘sk’ in wrong phase
#  420|   	addr.rc_channel = htobs(channel);
#  421|   
#  422|-> 	err = connect(sk, (struct sockaddr *) &addr, sizeof(addr));
#  423|   	if (err < 0 && !(errno == EAGAIN || errno == EINPROGRESS))
#  424|   		return err;

Error: GCC_ANALYZER_WARNING: [#def521]
bluez-5.76-build/bluez-5.76/tools/rfcomm-tester.c:422:15: warning[-Wanalyzer-fd-use-without-check]: ‘connect’ on possibly invalid file descriptor ‘sk’
#  420|   	addr.rc_channel = htobs(channel);
#  421|   
#  422|-> 	err = connect(sk, (struct sockaddr *) &addr, sizeof(addr));
#  423|   	if (err < 0 && !(errno == EAGAIN || errno == EINPROGRESS))
#  424|   		return err;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def522]
bluez-5.76-build/bluez-5.76/tools/rfcomm-tester.c: scope_hint: In function ‘rfcomm_listen_cb’
bluez-5.76-build/bluez-5.76/tools/rfcomm-tester.c:707:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘g_io_channel_unix_get_fd(io)’
#  705|   
#  706|   	new_sk = accept(sk, NULL, NULL);
#  707|-> 	if (new_sk < 0) {
#  708|   		tester_test_failed();
#  709|   		return false;

Error: CPPCHECK_WARNING: [#def523]
bluez-5.76-build/bluez-5.76/tools/rfcomm.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def524]
bluez-5.76-build/bluez-5.76/tools/rfcomm.c:234:3: warning[deadcode.DeadStores]: Value stored to 'i' is never read
#  232|   		sigaction(SIGPIPE, &sa, NULL);
#  233|   
#  234|-> 		i = execvp(cmdargv[0], cmdargv);
#  235|   		fprintf(stderr, "Couldn't execute command %s (errno=%d:%s)\n",
#  236|   				cmdargv[0], errno, strerror(errno));

Error: CLANG_WARNING: [#def525]
bluez-5.76-build/bluez-5.76/tools/rfcomm.c:234:7: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
#  232|   		sigaction(SIGPIPE, &sa, NULL);
#  233|   
#  234|-> 		i = execvp(cmdargv[0], cmdargv);
#  235|   		fprintf(stderr, "Couldn't execute command %s (errno=%d:%s)\n",
#  236|   				cmdargv[0], errno, strerror(errno));

Error: CLANG_WARNING: [#def526]
bluez-5.76-build/bluez-5.76/tools/rfcomm.c:354:8: warning[deadcode.DeadStores]: Although the value stored to 'fd' is used in the enclosing expression, the value is never actually read from 'fd'
#  352|   
#  353|   		snprintf(devname, MAXPATHLEN - 1, "/dev/bluetooth/rfcomm/%d", dev);
#  354|-> 		if ((fd = open(devname, O_RDONLY | O_NOCTTY)) < 0) {
#  355|   			if (try--) {
#  356|   				snprintf(devname, MAXPATHLEN - 1, "/dev/rfcomm%d", dev);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def527]
bluez-5.76-build/bluez-5.76/tools/rfcomm.c: scope_hint: In function ‘cmd_connect’
bluez-5.76-build/bluez-5.76/tools/rfcomm.c:354:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&devname, 256)’
bluez-5.76-build/bluez-5.76/tools/rfcomm.c:17: included_from: Included from here.
#  352|   
#  353|   		snprintf(devname, MAXPATHLEN - 1, "/dev/bluetooth/rfcomm/%d", dev);
#  354|-> 		if ((fd = open(devname, O_RDONLY | O_NOCTTY)) < 0) {
#  355|   			if (try--) {
#  356|   				snprintf(devname, MAXPATHLEN - 1, "/dev/rfcomm%d", dev);

Error: CLANG_WARNING: [#def528]
bluez-5.76-build/bluez-5.76/tools/rfcomm.c:497:14: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
#  495|   	bacpy(&req.src, &laddr.rc_bdaddr);
#  496|   	bacpy(&req.dst, &raddr.rc_bdaddr);
#  497|-> 	req.channel = raddr.rc_channel;
#  498|   
#  499|   	dev = ioctl(nsk, RFCOMMCREATEDEV, &req);

Error: CLANG_WARNING: [#def529]
bluez-5.76-build/bluez-5.76/tools/rfcomm.c:515:8: warning[deadcode.DeadStores]: Although the value stored to 'fd' is used in the enclosing expression, the value is never actually read from 'fd'
#  513|   
#  514|   		snprintf(devname, MAXPATHLEN - 1, "/dev/bluetooth/rfcomm/%d", dev);
#  515|-> 		if ((fd = open(devname, O_RDONLY | O_NOCTTY)) < 0) {
#  516|   			if (try--) {
#  517|   				snprintf(devname, MAXPATHLEN - 1, "/dev/rfcomm%d", dev);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def530]
bluez-5.76-build/bluez-5.76/tools/rfcomm.c: scope_hint: In function ‘cmd_listen’
bluez-5.76-build/bluez-5.76/tools/rfcomm.c:515:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&devname, 256)’
#  513|   
#  514|   		snprintf(devname, MAXPATHLEN - 1, "/dev/bluetooth/rfcomm/%d", dev);
#  515|-> 		if ((fd = open(devname, O_RDONLY | O_NOCTTY)) < 0) {
#  516|   			if (try--) {
#  517|   				snprintf(devname, MAXPATHLEN - 1, "/dev/rfcomm%d", dev);

Error: CPPCHECK_WARNING: [#def531]
bluez-5.76-build/bluez-5.76/tools/sco-tester.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-775): [#def532]
bluez-5.76-build/bluez-5.76/tools/sco-tester.c: scope_hint: In function ‘create_sco_sock’
bluez-5.76-build/bluez-5.76/tools/sco-tester.c:576:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sk’
#  574|   		tester_warn("Can't create socket: %s (%d)", strerror(errno),
#  575|   									errno);
#  576|-> 		return err;
#  577|   	}
#  578|   

Error: GCC_ANALYZER_WARNING (CWE-666): [#def533]
bluez-5.76-build/bluez-5.76/tools/sco-tester.c: scope_hint: In function ‘connect_sco_sock’
bluez-5.76-build/bluez-5.76/tools/sco-tester.c:616:15: warning[-Wanalyzer-fd-phase-mismatch]: ‘connect’ on file descriptor ‘sk’ in wrong phase
#  614|   	bacpy(&addr.sco_bdaddr, (void *) client_bdaddr);
#  615|   
#  616|-> 	err = connect(sk, (struct sockaddr *) &addr, sizeof(addr));
#  617|   	if (err < 0 && !(errno == EAGAIN || errno == EINPROGRESS)) {
#  618|   		err = -errno;

Error: CPPCHECK_WARNING: [#def534]
bluez-5.76-build/bluez-5.76/tools/scotest.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def535]
bluez-5.76-build/bluez-5.76/tools/sdptool.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def536]
bluez-5.76-build/bluez-5.76/tools/sdptool.c:941:26: warning[unix.MallocSizeof]: Result of 'malloc' is converted to a pointer of type 'uint32_t', which is incompatible with sizeof operand type 'int'
#  939|   		} else if (!strncasecmp(argv[i], "0x", 2)) {
#  940|   			/* Int */
#  941|-> 			uint32_t *value_int = malloc(sizeof(int));
#  942|   			if (!value_int) {
#  943|   				ret = -ENOMEM;

Error: CLANG_WARNING: [#def537]
bluez-5.76-build/bluez-5.76/tools/sdptool.c:980:4: warning[core.CallAndMessage]: 1st function call argument is an uninitialized value
#  978|   	for (i = 0; i < argc; i++)
#  979|   		if (allocArray)
#  980|-> 			free(allocArray[i]);
#  981|   
#  982|   	free(dtdArray);

Error: CLANG_WARNING: [#def538]
bluez-5.76-build/bluez-5.76/tools/sdptool.c:3777:2: warning[unix.Malloc]: Potential leak of memory pointed to by 'si.name'
# 3775|   	si.name = strdup(argv[0]);
# 3776|   
# 3777|-> 	return add_service(0, &si);
# 3778|   }
# 3779|   

Error: CLANG_WARNING: [#def539]
bluez-5.76-build/bluez-5.76/tools/sdptool.c:4112:4: warning[unix.Malloc]: Potential leak of memory pointed to by 'context.svc'
# 4110|   		if (!class && !uuid) {
# 4111|   			printf("Unknown service %s\n", context.svc);
# 4112|-> 			return -1;
# 4113|   		}
# 4114|   	}

Error: CPPCHECK_WARNING: [#def540]
bluez-5.76-build/bluez-5.76/tools/seq2bseq.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def541]
bluez-5.76-build/bluez-5.76/tools/smp-tester.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def542]
bluez-5.76-build/bluez-5.76/tools/test-runner.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-457): [#def543]
bluez-5.76-build/bluez-5.76/tools/test-runner.c:950: warning[uninitvar]: Uninitialized variable: argv
#  948|   	envp[pos] = NULL;
#  949|   
#  950|-> 	printf("Running command %s\n", cmdname ? cmdname : argv[0]);
#  951|   
#  952|   	pid = fork();

Scan Properties

analyzer-version-clang18.1.7
analyzer-version-cppcheck2.14.2
analyzer-version-gcc14.1.1
analyzer-version-gcc-analyzer14.1.1
analyzer-version-shellcheck0.10.0
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-127.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namebluez-5.76-1.fc41
store-results-to/tmp/tmpvlkjexjs/bluez-5.76-1.fc41.tar.xz
time-created2024-07-03 12:11:05
time-finished2024-07-03 12:16:46
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpvlkjexjs/bluez-5.76-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpvlkjexjs/bluez-5.76-1.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9