bluez-5.79-1.fc42

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1]
bluez-5.79-build/bluez-5.79/attrib/gattrib.c: scope_hint: In function ‘construct_full_pdu’
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-775): [#def2]
bluez-5.79-build/bluez-5.79/btio/btio.c: scope_hint: In function ‘server_cb.part.0’
bluez-5.79-build/bluez-5.79/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): [#def3]
bluez-5.79-build/bluez-5.79/btio/btio.c: scope_hint: In function ‘sco_connect’
bluez-5.79-build/bluez-5.79/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.79-build/bluez-5.79/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): [#def4]
bluez-5.79-build/bluez-5.79/btio/btio.c: scope_hint: In function ‘bt_io_listen’
bluez-5.79-build/bluez-5.79/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): [#def5]
bluez-5.79-build/bluez-5.79/client/advertising.c: scope_hint: In function ‘ad_register’
bluez-5.79-build/bluez-5.79/client/advertising.c:519: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.79-build/bluez-5.79/gdbus/gdbus.h:20: included_from: Included from here.
bluez-5.79-build/bluez-5.79/client/advertising.c:22: included_from: Included from here.
bluez-5.79-build/bluez-5.79/client/advertising.c:517:19: note: in expansion of macro ‘g_strdup’
bluez-5.79-build/bluez-5.79/client/advertising.c: scope_hint: In function ‘ad_register’
/usr/include/string.h:462: included_from: Included from here.
bluez-5.79-build/bluez-5.79/client/advertising.c:20: included_from: Included from here.
/usr/include/strings.h:116:12: note: argument 1 of ‘strcasecmp’ must be non-null
#  517|   	ad.type = g_strdup(type);
#  518|   
#  519|-> 	if (!strcasecmp(ad.type, "Broadcast"))
#  520|   		ad.discoverable = false;
#  521|   

Error: CPPCHECK_WARNING (CWE-457): [#def6]
bluez-5.79-build/bluez-5.79/client/assistant.c:181: warning[uninitvar]: Uninitialized variable: value
#  179|   	*val_len = i;
#  180|   
#  181|-> 	return util_memdup(value, i);
#  182|   }
#  183|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def7]
bluez-5.79-build/bluez-5.79/client/display.c: scope_hint: In function ‘rl_printf’
bluez-5.79-build/bluez-5.79/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 (CWE-457): [#def8]
bluez-5.79-build/bluez-5.79/client/gatt.c:730: warning[uninitvar]: Uninitialized variable: value
#  728|   	*val_len = i;
#  729|   
#  730|-> 	return util_memdup(value, i);
#  731|   }
#  732|   

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

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

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

Error: GCC_ANALYZER_WARNING (CWE-476): [#def12]
bluez-5.79-build/bluez-5.79/client/player.c: scope_hint: In function ‘codec_preset_add.part.0’
bluez-5.79-build/bluez-5.79/client/player.c:3493:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘preset’
# 3491|   	codec = codec_preset_new(name);
# 3492|   
# 3493|-> 	if (!preset->custom)
# 3494|   		preset->custom = queue_new();
# 3495|   

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

Error: GCC_ANALYZER_WARNING (CWE-775): [#def14]
bluez-5.79-build/bluez-5.79/client/player.c: scope_hint: In function ‘cmd_send_transport’
bluez-5.79-build/bluez-5.79/client/player.c:5562:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
bluez-5.79-build/bluez-5.79/client/player.c: scope_hint: In function ‘cmd_send_transport’
# 5560|   		if (!proxy) {
# 5561|   			bt_shell_printf("Transport %s not found\n", argv[i]);
# 5562|-> 			return bt_shell_noninteractive_quit(EXIT_FAILURE);
# 5563|   		}
# 5564|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def15]
bluez-5.79-build/bluez-5.79/emulator/b1ee.c: scope_hint: In function ‘server_read_callback.part.0’
bluez-5.79-build/bluez-5.79/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): [#def16]
bluez-5.79-build/bluez-5.79/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): [#def17]
bluez-5.79-build/bluez-5.79/emulator/b1ee.c: scope_hint: In function ‘main’
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-910): [#def18]
bluez-5.79-build/bluez-5.79/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: [#def19]
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-457): [#def20]
bluez-5.79-build/bluez-5.79/emulator/btdev.c: scope_hint: In function ‘le_meta_event’
bluez-5.79-build/bluez-5.79/emulator/btdev.c:3740:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘data’
bluez-5.79-build/bluez-5.79/emulator/btdev.c:31: included_from: Included from here.
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-126): [#def21]
bluez-5.79-build/bluez-5.79/emulator/bthost.c: scope_hint: In function ‘queue_command’
bluez-5.79-build/bluez-5.79/emulator/bthost.c:574:52: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
bluez-5.79-build/bluez-5.79/emulator/bthost.c:574:52: note: read of 8 bytes from after the end of ‘iov’
bluez-5.79-build/bluez-5.79/emulator/bthost.c:574:52: note: valid subscripts for ‘iov’ are ‘[0]’ to ‘[2]’
#  572|   
#  573|   	for (i = 0; i < iovlen; i++) {
#  574|-> 		memcpy(cmd->data + cmd->len, iov[i].iov_base, iov[i].iov_len);
#  575|   		cmd->len += iov[i].iov_len;
#  576|   	}

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

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

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

Error: GCC_ANALYZER_WARNING (CWE-688): [#def25]
bluez-5.79-build/bluez-5.79/emulator/serial.c: scope_hint: In function ‘serial_read_callback.part.0’
bluez-5.79-build/bluez-5.79/emulator/serial.c:130: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
#  128|   
#  129|   		if (count >= serial->pkt_expect) {
#  130|-> 			memcpy(serial->pkt_data + serial->pkt_len,
#  131|   						ptr, serial->pkt_expect);
#  132|   			ptr += serial->pkt_expect;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def26]
bluez-5.79-build/bluez-5.79/emulator/serial.c:141: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
#  139|   			serial->pkt_data = NULL;
#  140|   		} else {
#  141|-> 			memcpy(serial->pkt_data + serial->pkt_len, ptr, count);
#  142|   			serial->pkt_len += count;
#  143|   			serial->pkt_expect -= count;

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

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

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

Error: GCC_ANALYZER_WARNING (CWE-688): [#def30]
bluez-5.79-build/bluez-5.79/emulator/server.c: scope_hint: In function ‘client_read_callback.part.0’
bluez-5.79-build/bluez-5.79/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): [#def31]
bluez-5.79-build/bluez-5.79/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): [#def32]
bluez-5.79-build/bluez-5.79/emulator/server.c: scope_hint: In function ‘accept_client’
bluez-5.79-build/bluez-5.79/emulator/server.c:182:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘((struct server)*(void *)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): [#def33]
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-688): [#def34]
bluez-5.79-build/bluez-5.79/gdbus/object.c: scope_hint: In function 'invalidate_parent_data'
bluez-5.79-build/bluez-5.79/gdbus/object.c:772:17: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
bluez-5.79-build/bluez-5.79/gdbus/object.c: scope_hint: In function 'invalidate_parent_data'
bluez-5.79-build/bluez-5.79/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.79-build/bluez-5.79/gdbus/object.c:19: included_from: Included from here.
bluez-5.79-build/bluez-5.79/gdbus/object.c:771:23: note: in expansion of macro 'g_strdup'
bluez-5.79-build/bluez-5.79/gdbus/object.c: scope_hint: In function 'invalidate_parent_data'
bluez-5.79-build/bluez-5.79/gdbus/object.c:16: included_from: Included from here.
/usr/include/string.h:273:14: note: argument 1 of 'strrchr' must be non-null
#  770|   
#  771|   	parent_path = g_strdup(child_path);
#  772|-> 	slash = strrchr(parent_path, '/');
#  773|   	if (slash == NULL)
#  774|   		goto done;

Error: GCC_ANALYZER_WARNING (CWE-131): [#def35]
bluez-5.79-build/bluez-5.79/gobex/gobex-apparam.c: scope_hint: In function ‘tag_new’
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-688): [#def36]
bluez-5.79-build/bluez-5.79/gobex/gobex-header.c:95:9: warning[-Wanalyzer-null-argument]: use of NULL ‘utf16’ where non-null expected
bluez-5.79-build/bluez-5.79/gobex/gobex-header.c: scope_hint: In function ‘g_obex_header_encode’
bluez-5.79-build/bluez-5.79/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.79-build/bluez-5.79/gobex/gobex-header.h:13: included_from: Included from here.
bluez-5.79-build/bluez-5.79/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
#   93|   static guint8 *put_bytes(guint8 *to, const void *from, gsize count)
#   94|   {
#   95|-> 	memcpy(to, from, count);
#   96|   	return (to + count);
#   97|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def37]
bluez-5.79-build/bluez-5.79/gobex/gobex-header.c: scope_hint: In function ‘g_obex_header_create_list’
bluez-5.79-build/bluez-5.79/gobex/gobex-header.c:563:34: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘hdr’
bluez-5.79-build/bluez-5.79/gobex/gobex-header.c:540:25: note: in expansion of macro ‘G_OBEX_HDR_ENC’
#  561|   
#  562|   		l = g_slist_append(l, hdr);
#  563|-> 		*total_len += hdr->hlen;
#  564|   		id = va_arg(args, int);
#  565|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def38]
bluez-5.79-build/bluez-5.79/lib/sdp.c: scope_hint: In function 'sdp_connect_local'
bluez-5.79-build/bluez-5.79/lib/sdp.c:4674:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'socket(1, 524289, 0)'
# 4672|   	strcpy(sa.sun_path, SDP_UNIX_PATH);
# 4673|   
# 4674|-> 	return connect(session->sock, (struct sockaddr *) &sa, sizeof(sa));
# 4675|   }
# 4676|   

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

Error: GCC_ANALYZER_WARNING (CWE-666): [#def40]
bluez-5.79-build/bluez-5.79/lib/sdp.c:4740:27: warning[-Wanalyzer-fd-phase-mismatch]: 'connect' on file descriptor '*session.sock' in wrong phase
# 4738|   
# 4739|   	do {
# 4740|-> 		int ret = connect(sk, (struct sockaddr *) &sa, sizeof(sa));
# 4741|   		if (!ret)
# 4742|   			return 0;

Error: GCC_ANALYZER_WARNING (CWE-666): [#def41]
bluez-5.79-build/bluez-5.79/lib/sdp.c:4740:27: warning[-Wanalyzer-fd-phase-mismatch]: 'connect' on file descriptor 'socket(31, sockflags, 0)' in wrong phase
# 4738|   
# 4739|   	do {
# 4740|-> 		int ret = connect(sk, (struct sockaddr *) &sa, sizeof(sa));
# 4741|   		if (!ret)
# 4742|   			return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def42]
bluez-5.79-build/bluez-5.79/mesh/mesh-io-unit.c: scope_hint: In function ‘unit_init’
bluez-5.79-build/bluez-5.79/mesh/mesh-io-unit.c:238:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*(struct mesh_io_private *)<unknown>.fd’
bluez-5.79-build/bluez-5.79/ell/ell.h:1: included_from: Included from here.
bluez-5.79-build/bluez-5.79/mesh/mesh-io-unit.c:22: included_from: Included from here.
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-126): [#def43]
bluez-5.79-build/bluez-5.79/mesh/net.c: scope_hint: In function ‘friend_packet_queue’
bluez-5.79-build/bluez-5.79/mesh/net.c:1349:25: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
bluez-5.79-build/bluez-5.79/ell/ell.h:1: included_from: Included from here.
bluez-5.79-build/bluez-5.79/mesh/net.c:19: included_from: Included from here.
bluez-5.79-build/bluez-5.79/mesh/net.c:1198:28: note: in expansion of macro ‘l_new’
bluez-5.79-build/bluez-5.79/mesh/net.c:26: included_from: Included from here.
bluez-5.79-build/bluez-5.79/mesh/net.c:1366:29: note: in expansion of macro ‘FRND_OPCODE’
bluez-5.79-build/bluez-5.79/mesh/net.c:1349:25: note: read of 9 bytes from after the end of ‘msg’
bluez-5.79-build/bluez-5.79/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): [#def44]
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-688): [#def45]
bluez-5.79-build/bluez-5.79/mesh/node.c: scope_hint: In function ‘check_req_node’
bluez-5.79-build/bluez-5.79/mesh/node.c:1549:33: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
bluez-5.79-build/bluez-5.79/ell/util.h:11: included_from: Included from here.
bluez-5.79-build/bluez-5.79/ell/ell.h:1: included_from: Included from here.
bluez-5.79-build/bluez-5.79/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): [#def46]
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-465): [#def47]
bluez-5.79-build/bluez-5.79/mesh/prov-acceptor.c: scope_hint: In function ‘acp_prov_rx’
bluez-5.79-build/bluez-5.79/mesh/prov-acceptor.c:685:12: warning[-Wanalyzer-deref-before-check]: check of ‘prov’ for NULL after already dereferencing it
bluez-5.79-build/bluez-5.79/ell/ell.h:2: included_from: Included from here.
bluez-5.79-build/bluez-5.79/mesh/prov-acceptor.c:15: included_from: Included from here.
bluez-5.79-build/bluez-5.79/ell/log.h:90:31: note: in expansion of macro ‘L_DEBUG_SYMBOL’
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-465): [#def48]
bluez-5.79-build/bluez-5.79/mesh/prov-initiator.c: scope_hint: In function ‘int_prov_rx’
bluez-5.79-build/bluez-5.79/mesh/prov-initiator.c:837:12: warning[-Wanalyzer-deref-before-check]: check of ‘prov’ for NULL after already dereferencing it
bluez-5.79-build/bluez-5.79/ell/ell.h:2: included_from: Included from here.
bluez-5.79-build/bluez-5.79/mesh/prov-initiator.c:15: included_from: Included from here.
bluez-5.79-build/bluez-5.79/ell/log.h:90:31: note: in expansion of macro ‘L_DEBUG_SYMBOL’
bluez-5.79-build/bluez-5.79/mesh/prov-initiator.c:664:9: note: in expansion of macro ‘l_debug’
#  835|   	}
#  836|   
#  837|-> 	if (prov)
#  838|   		prov->previous = type;
#  839|   

Error: CPPCHECK_WARNING (CWE-457): [#def49]
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-457): [#def50]
bluez-5.79-build/bluez-5.79/monitor/bnep.c: scope_hint: In function ‘get_macaddr’
bluez-5.79-build/bluez-5.79/monitor/bnep.c:62:66: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘addr[5]’
bluez-5.79-build/bluez-5.79/monitor/bnep.c:30: included_from: Included from here.
bluez-5.79-build/bluez-5.79/monitor/l2cap.h: scope_hint: In function ‘get_macaddr’
bluez-5.79-build/bluez-5.79/monitor/l2cap.h: scope_hint: In function ‘get_macaddr’
bluez-5.79-build/bluez-5.79/monitor/bnep.c:29: included_from: Included from here.
bluez-5.79-build/bluez-5.79/monitor/display.h:56:17: note: in expansion of macro ‘print_indent’
bluez-5.79-build/bluez-5.79/monitor/bnep.c:222:9: note: in expansion of macro ‘print_field’
bluez-5.79-build/bluez-5.79/monitor/l2cap.h: scope_hint: In function ‘get_macaddr’
bluez-5.79-build/bluez-5.79/monitor/l2cap.h: scope_hint: In function ‘get_macaddr’
bluez-5.79-build/bluez-5.79/monitor/l2cap.h: scope_hint: In function ‘get_macaddr’
bluez-5.79-build/bluez-5.79/monitor/bnep.c: scope_hint: In function ‘get_macaddr’
bluez-5.79-build/bluez-5.79/monitor/l2cap.h: scope_hint: In function ‘get_macaddr’
bluez-5.79-build/bluez-5.79/monitor/l2cap.h: scope_hint: In function ‘get_macaddr’
bluez-5.79-build/bluez-5.79/monitor/l2cap.h: scope_hint: In function ‘get_macaddr’
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-775): [#def51]
bluez-5.79-build/bluez-5.79/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): [#def52]
bluez-5.79-build/bluez-5.79/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): [#def53]
bluez-5.79-build/bluez-5.79/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): [#def54]
bluez-5.79-build/bluez-5.79/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): [#def55]
bluez-5.79-build/bluez-5.79/monitor/display.c: scope_hint: In function ‘open_pager’
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-476): [#def56]
bluez-5.79-build/bluez-5.79/monitor/jlink.c: scope_hint: In function ‘jlink_start_rtt’
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-476): [#def57]
bluez-5.79-build/bluez-5.79/obexd/plugins/messages-dummy.c: scope_hint: In function ‘return_folder_listing’
bluez-5.79-build/bluez-5.79/obexd/plugins/messages-dummy.c:163:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘cur’
bluez-5.79-build/bluez-5.79/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 (CWE-570): [#def58]
bluez-5.79-build/bluez-5.79/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): [#def59]
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-457): [#def60]
bluez-5.79-build/bluez-5.79/obexd/client/bip.c:19: included_from: Included from here.
bluez-5.79-build/bluez-5.79/obexd/client/bip.c: scope_hint: In function ‘parse_get_image_dict’
bluez-5.79-build/bluez-5.79/obexd/src/log.h:42:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*maxsize’
bluez-5.79-build/bluez-5.79/obexd/client/bip.c:264:9: note: in expansion of macro ‘DBG’
/usr/include/glib-2.0/glib.h:52: included_from: Included from here.
bluez-5.79-build/bluez-5.79/gdbus/gdbus.h:20: included_from: Included from here.
bluez-5.79-build/bluez-5.79/obexd/client/bip.c:16: included_from: Included from here.
bluez-5.79-build/bluez-5.79/obexd/client/bip.c:236:36: note: in expansion of macro ‘g_str_equal’
bluez-5.79-build/bluez-5.79/obexd/client/bip.c:242:36: note: in expansion of macro ‘g_str_equal’
bluez-5.79-build/bluez-5.79/obexd/client/bip.c:264:9: note: in expansion of macro ‘DBG’
bluez-5.79-build/bluez-5.79/obexd/client/bip.c:264:9: note: in expansion of macro ‘DBG’
bluez-5.79-build/bluez-5.79/obexd/client/bip.c:264:9: note: in expansion of macro ‘DBG’
#   40|   	}; \
#   41|   	if (__obex_debug_desc.flags & OBEX_DEBUG_FLAG_PRINT) \
#   42|-> 		obex_debug("%s:%s() " fmt,  __FILE__, __func__ , ## arg); \
#   43|   } while (0)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def61]
bluez-5.79-build/bluez-5.79/profiles/audio/a2dp.c: scope_hint: In function ‘select_cb’
bluez-5.79-build/bluez-5.79/profiles/audio/a2dp.c:2811:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘*setup.rsep’
# 2809|   
# 2810|   	setup->rsep = find_remote_sep(setup->chan, setup->sep);
# 2811|-> 	service = avdtp_get_codec(setup->rsep->sep);
# 2812|   	codec = (struct avdtp_media_codec_capability *) service->data;
# 2813|   

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

Error: GCC_ANALYZER_WARNING (CWE-688): [#def63]
bluez-5.79-build/bluez-5.79/profiles/audio/avrcp.c: scope_hint: In function ‘play_status_to_val’
bluez-5.79-build/bluez-5.79/profiles/audio/avrcp.c:742:14: warning[-Wanalyzer-null-argument]: use of NULL ‘status’ where non-null expected
bluez-5.79-build/bluez-5.79/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.79-build/bluez-5.79/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
#  740|   static int play_status_to_val(const char *status)
#  741|   {
#  742|-> 	if (!strcasecmp(status, "stopped"))
#  743|   		return AVRCP_PLAY_STATUS_STOPPED;
#  744|   	else if (!strcasecmp(status, "playing"))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def64]
bluez-5.79-build/bluez-5.79/profiles/audio/avrcp.c: scope_hint: In function ‘avrcp_player_event.part.0’
bluez-5.79-build/bluez-5.79/profiles/audio/avrcp.c:825:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘data’
bluez-5.79-build/bluez-5.79/profiles/audio/avrcp.c: scope_hint: In function ‘avrcp_player_event.part.0’
#  823|   	case AVRCP_EVENT_TRACK_CHANGED:
#  824|   		size = 9;
#  825|-> 		memcpy(&pdu->params[1], data, sizeof(uint64_t));
#  826|   
#  827|   		break;

Error: CPPCHECK_WARNING (CWE-457): [#def65]
bluez-5.79-build/bluez-5.79/profiles/audio/avrcp.c:2376: warning[uninitvar]: Uninitialized variable: attrs
# 2374|   	pdu->params[0] = count;
# 2375|   
# 2376|-> 	memcpy(pdu->params + 1, attrs, count);
# 2377|   
# 2378|   	avctp_send_vendordep_req(session->conn, AVC_CTYPE_STATUS,

Error: GCC_ANALYZER_WARNING (CWE-688): [#def66]
bluez-5.79-build/bluez-5.79/profiles/audio/player.c: scope_hint: In function ‘media_player_set_setting’
bluez-5.79-build/bluez-5.79/profiles/audio/player.c:1384: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.79-build/bluez-5.79/profiles/audio/player.c:25: included_from: Included from here.
bluez-5.79-build/bluez-5.79/profiles/audio/player.c:1375:59: note: in expansion of macro ‘g_strdup’
bluez-5.79-build/bluez-5.79/profiles/audio/player.c: scope_hint: In function ‘media_player_set_setting’
bluez-5.79-build/bluez-5.79/profiles/audio/player.c:1375:44: note: in expansion of macro ‘g_strdup’
bluez-5.79-build/bluez-5.79/profiles/audio/player.c: scope_hint: In function ‘media_player_set_setting’
/usr/include/string.h:462: included_from: Included from here.
bluez-5.79-build/bluez-5.79/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
# 1382|   		return;
# 1383|   
# 1384|-> 	if (strcasecmp(value, p->value) == 0)
# 1385|   		g_dbus_pending_property_success(p->id);
# 1386|   	else

Error: GCC_ANALYZER_WARNING (CWE-666): [#def67]
bluez-5.79-build/bluez-5.79/profiles/cups/hcrp.c: scope_hint: In function ‘hcrp_print’
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-457): [#def68]
bluez-5.79-build/bluez-5.79/profiles/cups/main.c: scope_hint: In function ‘main’
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-666): [#def69]
bluez-5.79-build/bluez-5.79/profiles/cups/spp.c: scope_hint: In function ‘spp_print’
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-476): [#def70]
bluez-5.79-build/bluez-5.79/src/adv_monitor.c: scope_hint: In function ‘monitor_process’
bluez-5.79-build/bluez-5.79/src/adv_monitor.c:976:48: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*monitor.merged_pattern’
bluez-5.79-build/bluez-5.79/src/adv_monitor.c:36: included_from: Included from here.
bluez-5.79-build/bluez-5.79/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): [#def71]
bluez-5.79-build/bluez-5.79/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.79-build/bluez-5.79/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.79-build/bluez-5.79/src/adv_monitor.c:695:19: note: in expansion of macro ‘new0’
bluez-5.79-build/bluez-5.79/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): [#def72]
bluez-5.79-build/bluez-5.79/src/battery.c:234:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘battery’
bluez-5.79-build/bluez-5.79/src/log.h:60:9: note: in expansion of macro ‘DBG_IDX’
bluez-5.79-build/bluez-5.79/src/battery.c:222:9: note: in expansion of macro ‘DBG’
#  232|   	}
#  233|   
#  234|-> 	if (battery->percentage == percentage)
#  235|   		return true;
#  236|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def73]
bluez-5.79-build/bluez-5.79/src/device.c: scope_hint: In function ‘device_bonding_retry’
bluez-5.79-build/bluez-5.79/src/device.c:6681:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘data’
bluez-5.79-build/bluez-5.79/src/device.c: scope_hint: In function ‘device_bonding_retry’
# 6679|   	struct btd_device *device = data;
# 6680|   	struct btd_adapter *adapter = device_get_adapter(device);
# 6681|-> 	struct bonding_req *bonding = device->bonding;
# 6682|   	uint8_t io_cap;
# 6683|   	int err;

Error: CPPCHECK_WARNING (CWE-570): [#def74]
bluez-5.79-build/bluez-5.79/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): [#def75]
bluez-5.79-build/bluez-5.79/src/battery.c:28: included_from: Included from here.
bluez-5.79-build/bluez-5.79/src/battery.c: scope_hint: In function ‘btd_battery_update’
bluez-5.79-build/bluez-5.79/src/log.h:56:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘battery’
bluez-5.79-build/bluez-5.79/src/log.h:60:9: note: in expansion of macro ‘DBG_IDX’
bluez-5.79-build/bluez-5.79/src/battery.c:222:9: note: in expansion of macro ‘DBG’
bluez-5.79-build/bluez-5.79/src/log.h:60:9: note: in expansion of macro ‘DBG_IDX’
bluez-5.79-build/bluez-5.79/src/battery.c:222:9: note: in expansion of macro ‘DBG’
bluez-5.79-build/bluez-5.79/src/log.h:60:9: note: in expansion of macro ‘DBG_IDX’
bluez-5.79-build/bluez-5.79/src/battery.c:222:9: note: in expansion of macro ‘DBG’
bluez-5.79-build/bluez-5.79/src/log.h:60:9: note: in expansion of macro ‘DBG_IDX’
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-476): [#def76]
bluez-5.79-build/bluez-5.79/src/sdp-client.c:353:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
bluez-5.79-build/bluez-5.79/src/sdp-client.c: scope_hint: In function ‘bt_search_service’
bluez-5.79-build/bluez-5.79/src/sdp-client.c: scope_hint: In function ‘bt_search_service’
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-476): [#def77]
bluez-5.79-build/bluez-5.79/src/sdp-xml.c: scope_hint: In function ‘element_start.part.0’
bluez-5.79-build/bluez-5.79/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): [#def78]
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-688): [#def79]
bluez-5.79-build/bluez-5.79/src/sdpd-request.c: scope_hint: In function ‘sdp_cstate_alloc_buf’
bluez-5.79-build/bluez-5.79/src/sdpd-request.c:105:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘data’ where non-null expected
bluez-5.79-build/bluez-5.79/src/sdpd-request.c: scope_hint: In function ‘sdp_cstate_alloc_buf’
bluez-5.79-build/bluez-5.79/src/sdpd-request.c: scope_hint: In function ‘sdp_cstate_alloc_buf’
bluez-5.79-build/bluez-5.79/src/shared/util.h:216:16: note: in expansion of macro ‘be16_to_cpu’
bluez-5.79-build/bluez-5.79/src/shared/util.h:216:28: note: in expansion of macro ‘get_unaligned’
bluez-5.79-build/bluez-5.79/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): [#def80]
bluez-5.79-build/bluez-5.79/src/sdpd-request.c:106:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘cinfo’ where non-null expected
bluez-5.79-build/bluez-5.79/src/sdpd-request.c: scope_hint: In function ‘sdp_cstate_alloc_buf’
bluez-5.79-build/bluez-5.79/src/sdpd-request.c: scope_hint: In function ‘sdp_cstate_alloc_buf’
bluez-5.79-build/bluez-5.79/src/shared/util.h:216:16: note: in expansion of macro ‘be16_to_cpu’
bluez-5.79-build/bluez-5.79/src/shared/util.h:216:28: note: in expansion of macro ‘get_unaligned’
bluez-5.79-build/bluez-5.79/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): [#def81]
bluez-5.79-build/bluez-5.79/src/sdpd-request.c: scope_hint: In function ‘extract_des’
bluez-5.79-build/bluez-5.79/src/sdpd-request.c:203:42: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘aid’
bluez-5.79-build/bluez-5.79/src/sdpd-request.c: scope_hint: In function ‘extract_des’
bluez-5.79-build/bluez-5.79/src/sdpd-request.c: scope_hint: In function ‘extract_des’
bluez-5.79-build/bluez-5.79/src/shared/util.h:240:16: note: in expansion of macro ‘be32_to_cpu’
bluez-5.79-build/bluez-5.79/src/shared/util.h:240:28: note: in expansion of macro ‘get_unaligned’
bluez-5.79-build/bluez-5.79/src/sdpd-request.c: scope_hint: In function ‘extract_des’
bluez-5.79-build/bluez-5.79/src/shared/util.h:216:16: note: in expansion of macro ‘be16_to_cpu’
bluez-5.79-build/bluez-5.79/src/shared/util.h:216:28: note: in expansion of macro ‘get_unaligned’
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-476): [#def82]
bluez-5.79-build/bluez-5.79/src/sdpd-request.c:230:42: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘aid’
bluez-5.79-build/bluez-5.79/src/sdpd-request.c: scope_hint: In function ‘extract_des’
bluez-5.79-build/bluez-5.79/src/sdpd-request.c: scope_hint: In function ‘extract_des’
bluez-5.79-build/bluez-5.79/src/shared/util.h:240:16: note: in expansion of macro ‘be32_to_cpu’
bluez-5.79-build/bluez-5.79/src/shared/util.h:240:28: note: in expansion of macro ‘get_unaligned’
bluez-5.79-build/bluez-5.79/src/sdpd-request.c: scope_hint: In function ‘extract_des’
bluez-5.79-build/bluez-5.79/src/shared/util.h:216:16: note: in expansion of macro ‘be16_to_cpu’
bluez-5.79-build/bluez-5.79/src/shared/util.h:216:28: note: in expansion of macro ‘get_unaligned’
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-688): [#def83]
bluez-5.79-build/bluez-5.79/src/sdpd-request.c: scope_hint: In function ‘process_request’
bluez-5.79-build/bluez-5.79/src/sdpd-request.c:1017:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘buf’ where non-null expected
bluez-5.79-build/bluez-5.79/src/sdpd-request.c: scope_hint: In function ‘process_request’
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-688): [#def84]
bluez-5.79-build/bluez-5.79/src/shared/ad.c: scope_hint: In function 'ad_replace_data'
bluez-5.79-build/bluez-5.79/src/shared/ad.c:394:17: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
bluez-5.79-build/bluez-5.79/src/shared/ad.c:26: included_from: Included from here.
bluez-5.79-build/bluez-5.79/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): [#def85]
bluez-5.79-build/bluez-5.79/src/shared/ad.c: scope_hint: In function 'bt_ad_add_manufacturer_data'
bluez-5.79-build/bluez-5.79/src/shared/ad.c:852:17: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
bluez-5.79-build/bluez-5.79/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): [#def86]
bluez-5.79-build/bluez-5.79/src/shared/ad.c: scope_hint: In function 'bt_ad_add_service_data'
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-476): [#def87]
bluez-5.79-build/bluez-5.79/src/shared/bap.c: scope_hint: In function 'bap_get_session.part.0'
bluez-5.79-build/bluez-5.79/src/shared/bap.c:661:18: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
#  659|   
#  660|   	bap = bt_bap_new(db, NULL);
#  661|-> 	bap->att = att;
#  662|   
#  663|   	bt_bap_attach(bap, NULL);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def88]
bluez-5.79-build/bluez-5.79/src/shared/bap.c: scope_hint: In function 'bap_send'
bluez-5.79-build/bluez-5.79/src/shared/bap.c:1535:50: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.79-build/bluez-5.79/src/shared/bap.c:1574:9: note: in expansion of macro 'DBG'
bluez-5.79-build/bluez-5.79/src/shared/bap.c:1574:9: note: in expansion of macro 'DBG'
bluez-5.79-build/bluez-5.79/src/shared/bap.c:1528:9: note: in expansion of macro 'DBG'
bluez-5.79-build/bluez-5.79/src/shared/bap.c:1528:9: note: in expansion of macro 'DBG'
# 1533|   	}
# 1534|   
# 1535|-> 	if (!gatt_db_attribute_get_char_data(ascs->ase_cp, NULL, &handle,
# 1536|   						NULL, NULL, NULL)) {
# 1537|   		DBG(bap, "Unable to find Control Point");

Error: GCC_ANALYZER_WARNING (CWE-476): [#def89]
bluez-5.79-build/bluez-5.79/src/shared/bap.c: scope_hint: In function 'bap_cp_attach'
bluez-5.79-build/bluez-5.79/src/shared/bap.c:5114:50: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
# 5112|   	struct bt_ascs *ascs = bap_get_ascs(bap);
# 5113|   
# 5114|-> 	if (!gatt_db_attribute_get_char_data(ascs->ase_cp, NULL,
# 5115|   						&value_handle,
# 5116|   						NULL, NULL, NULL))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def90]
bluez-5.79-build/bluez-5.79/src/shared/bap.c: scope_hint: In function 'foreach_ascs_service'
bluez-5.79-build/bluez-5.79/src/shared/bap.c:5179:23: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
# 5177|   	struct bt_ascs *ascs = bap_get_ascs(bap);
# 5178|   
# 5179|-> 	ascs->service = attr;
# 5180|   
# 5181|   	gatt_db_service_set_claimed(attr, true);

Error: GCC_ANALYZER_WARNING (CWE-465): [#def91]
bluez-5.79-build/bluez-5.79/src/shared/bap.c: scope_hint: In function 'bap_bcast_stream_new'
bluez-5.79-build/bluez-5.79/src/shared/bap.c:5843:20: warning[-Wanalyzer-deref-before-check]: check of 'lpac' for NULL after already dereferencing it
# 5841|   
# 5842|   		bt_bap_foreach_pac(bap, BT_BAP_BCAST_SINK, match_pac, &match);
# 5843|-> 		if ((!match.lpac) || (!lpac))
# 5844|   			return NULL;
# 5845|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def92]
bluez-5.79-build/bluez-5.79/src/shared/bass.c: scope_hint: In function 'bass_build_bcast_src'
bluez-5.79-build/bluez-5.79/src/shared/bass.c:420:17: warning[-Wanalyzer-null-dereference]: dereference of NULL 'bad_code'
#  418|   
#  419|   	if (enc == BT_BASS_BIG_ENC_STATE_BAD_CODE)
#  420|-> 		memcpy(bcast_src->bad_code, bad_code, BT_BASS_BCAST_CODE_SIZE);
#  421|   	else
#  422|   		memset(bcast_src->bad_code, 0, BT_BASS_BCAST_CODE_SIZE);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def93]
bluez-5.79-build/bluez-5.79/src/shared/bass.c: scope_hint: In function 'bass_get_session.part.0'
bluez-5.79-build/bluez-5.79/src/shared/bass.c:705:19: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
#  703|   
#  704|   	bass = bt_bass_new(db, NULL, adapter_bdaddr);
#  705|-> 	bass->att = att;
#  706|   
#  707|   	bt_bass_attach(bass, NULL);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def94]
bluez-5.79-build/bluez-5.79/src/shared/ccp.c: scope_hint: In function 'bt_ccp_incom_call_attach'
bluez-5.79-build/bluez-5.79/src/shared/ccp.c:661:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.79-build/bluez-5.79/src/shared/ccp.c:659:9: note: in expansion of macro 'DBG'
bluez-5.79-build/bluez-5.79/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): [#def95]
bluez-5.79-build/bluez-5.79/src/shared/ccp.c: scope_hint: In function 'bt_ccp_call_state_attach'
bluez-5.79-build/bluez-5.79/src/shared/ccp.c:683:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.79-build/bluez-5.79/src/shared/ccp.c:681:9: note: in expansion of macro 'DBG'
bluez-5.79-build/bluez-5.79/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): [#def96]
bluez-5.79-build/bluez-5.79/src/shared/ccp.c: scope_hint: In function 'bt_ccp_call_list_attach'
bluez-5.79-build/bluez-5.79/src/shared/ccp.c:705:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.79-build/bluez-5.79/src/shared/ccp.c:703:9: note: in expansion of macro 'DBG'
bluez-5.79-build/bluez-5.79/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): [#def97]
bluez-5.79-build/bluez-5.79/src/shared/ccp.c: scope_hint: In function 'bt_ccp_name_attach'
bluez-5.79-build/bluez-5.79/src/shared/ccp.c:727:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.79-build/bluez-5.79/src/shared/ccp.c:725:9: note: in expansion of macro 'DBG'
bluez-5.79-build/bluez-5.79/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): [#def98]
bluez-5.79-build/bluez-5.79/src/shared/ccp.c: scope_hint: In function 'bt_ccp_term_reason_attach'
bluez-5.79-build/bluez-5.79/src/shared/ccp.c:749:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.79-build/bluez-5.79/src/shared/ccp.c:747:9: note: in expansion of macro 'DBG'
bluez-5.79-build/bluez-5.79/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): [#def99]
bluez-5.79-build/bluez-5.79/src/shared/ccp.c: scope_hint: In function 'bt_ccp_status_attach'
bluez-5.79-build/bluez-5.79/src/shared/ccp.c:770:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.79-build/bluez-5.79/src/shared/ccp.c:768:9: note: in expansion of macro 'DBG'
bluez-5.79-build/bluez-5.79/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): [#def100]
bluez-5.79-build/bluez-5.79/src/shared/ccp.c: scope_hint: In function 'bt_ccp_uci_attach'
bluez-5.79-build/bluez-5.79/src/shared/ccp.c:792:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.79-build/bluez-5.79/src/shared/ccp.c:790:9: note: in expansion of macro 'DBG'
bluez-5.79-build/bluez-5.79/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): [#def101]
bluez-5.79-build/bluez-5.79/src/shared/ccp.c: scope_hint: In function 'bt_ccp_technology_attach'
bluez-5.79-build/bluez-5.79/src/shared/ccp.c:813:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.79-build/bluez-5.79/src/shared/ccp.c:811:9: note: in expansion of macro 'DBG'
bluez-5.79-build/bluez-5.79/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): [#def102]
bluez-5.79-build/bluez-5.79/src/shared/ccp.c: scope_hint: In function 'bt_ccp_strength_attach'
bluez-5.79-build/bluez-5.79/src/shared/ccp.c:833:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.79-build/bluez-5.79/src/shared/ccp.c:831:9: note: in expansion of macro 'DBG'
bluez-5.79-build/bluez-5.79/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): [#def103]
bluez-5.79-build/bluez-5.79/src/shared/ccp.c: scope_hint: In function 'bt_ccp_ccid_attach'
bluez-5.79-build/bluez-5.79/src/shared/ccp.c:853:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.79-build/bluez-5.79/src/shared/ccp.c:851:9: note: in expansion of macro 'DBG'
bluez-5.79-build/bluez-5.79/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): [#def104]
bluez-5.79-build/bluez-5.79/src/shared/ccp.c: scope_hint: In function 'bt_ccp_tar_uri_attach'
bluez-5.79-build/bluez-5.79/src/shared/ccp.c:872:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.79-build/bluez-5.79/src/shared/ccp.c:870:9: note: in expansion of macro 'DBG'
bluez-5.79-build/bluez-5.79/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): [#def105]
bluez-5.79-build/bluez-5.79/src/shared/ccp.c: scope_hint: In function 'bt_ccp_ctrl_point_attach'
bluez-5.79-build/bluez-5.79/src/shared/ccp.c:893:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.79-build/bluez-5.79/src/shared/ccp.c:891:9: note: in expansion of macro 'DBG'
bluez-5.79-build/bluez-5.79/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): [#def106]
bluez-5.79-build/bluez-5.79/src/shared/ccp.c: scope_hint: In function 'bt_ccp_ctrl_opcode_attach'
bluez-5.79-build/bluez-5.79/src/shared/ccp.c:913:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.79-build/bluez-5.79/src/shared/ccp.c:911:9: note: in expansion of macro 'DBG'
bluez-5.79-build/bluez-5.79/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): [#def107]
bluez-5.79-build/bluez-5.79/src/shared/ccp.c: scope_hint: In function 'bt_ccp_friendly_name_attach'
bluez-5.79-build/bluez-5.79/src/shared/ccp.c:933:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.79-build/bluez-5.79/src/shared/ccp.c:931:9: note: in expansion of macro 'DBG'
bluez-5.79-build/bluez-5.79/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): [#def108]
bluez-5.79-build/bluez-5.79/src/shared/ccp.c: scope_hint: In function 'bt_ccp_signal_intrvl_attach'
bluez-5.79-build/bluez-5.79/src/shared/ccp.c:953:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.79-build/bluez-5.79/src/shared/ccp.c:951:9: note: in expansion of macro 'DBG'
bluez-5.79-build/bluez-5.79/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): [#def109]
bluez-5.79-build/bluez-5.79/src/shared/ccp.c: scope_hint: In function 'bt_ccp_uri_list_attach'
bluez-5.79-build/bluez-5.79/src/shared/ccp.c:973:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.79-build/bluez-5.79/src/shared/ccp.c:971:9: note: in expansion of macro 'DBG'
bluez-5.79-build/bluez-5.79/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): [#def110]
bluez-5.79-build/bluez-5.79/src/shared/ccp.c: scope_hint: In function 'foreach_ccs_service'
bluez-5.79-build/bluez-5.79/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): [#def111]
bluez-5.79-build/bluez-5.79/src/shared/crypto.c: scope_hint: In function 'alg_new'
bluez-5.79-build/bluez-5.79/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): [#def112]
bluez-5.79-build/bluez-5.79/src/shared/crypto.c:212:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor '*crypto.ecb_aes'
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-416): [#def113]
bluez-5.79-build/bluez-5.79/src/shared/gatt-client.c: scope_hint: In function 'request_unref'
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-416): [#def114]
bluez-5.79-build/bluez-5.79/src/shared/gatt-client.c: scope_hint: In function 'complete_write_long_op'
bluez-5.79-build/bluez-5.79/src/shared/gatt-client.c:3295:31: warning[-Wanalyzer-use-after-free]: use after 'free' of 'req'
# 3293|   					uint8_t att_ecode, bool reliable_error)
# 3294|   {
# 3295|-> 	struct long_write_op *op = req->data;
# 3296|   	uint8_t pdu;
# 3297|   	int err;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def115]
bluez-5.79-build/bluez-5.79/src/shared/gatt-db.c: scope_hint: In function 'read_ext_prop_value'
bluez-5.79-build/bluez-5.79/src/shared/gatt-db.c:1902:37: warning[-Wanalyzer-null-dereference]: dereference of NULL 'value'
# 1900|   		return;
# 1901|   
# 1902|-> 	*ext_prop = (uint16_t) value[0];
# 1903|   }
# 1904|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def116]
bluez-5.79-build/bluez-5.79/src/shared/gatt-server.c: scope_hint: In function 'read_by_grp_type_cb'
bluez-5.79-build/bluez-5.79/src/shared/gatt-server.c:322:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'type'
bluez-5.79-build/bluez-5.79/src/shared/att.h:11: included_from: Included from here.
bluez-5.79-build/bluez-5.79/src/shared/gatt-server.c:19: included_from: Included from here.
#  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): [#def117]
bluez-5.79-build/bluez-5.79/src/shared/gatt-server.c: scope_hint: In function 'read_by_type_cb'
bluez-5.79-build/bluez-5.79/src/shared/gatt-server.c:528:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'type'
#  526|   	}
#  527|   
#  528|-> 	gatt_db_read_by_type(server->db, start, end, type, q);
#  529|   
#  530|   	if (queue_isempty(q)) {

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

Error: GCC_ANALYZER_WARNING (CWE-476): [#def119]
bluez-5.79-build/bluez-5.79/src/shared/mcp.c: scope_hint: In function 'mcp_send'
bluez-5.79-build/bluez-5.79/src/shared/mcp.c:586:17: warning[-Wanalyzer-null-dereference]: dereference of NULL 'mcp'
bluez-5.79-build/bluez-5.79/src/shared/mcp.c:584:9: note: in expansion of macro 'DBG'
bluez-5.79-build/bluez-5.79/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): [#def120]
bluez-5.79-build/bluez-5.79/src/shared/mcp.c: scope_hint: In function 'bt_mcp_mp_name_attach'
bluez-5.79-build/bluez-5.79/src/shared/mcp.c:1068:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
# 1066|   	struct bt_mcs *mcs = mcp_get_mcs(mcp);
# 1067|   
# 1068|-> 	if (!gatt_db_attribute_get_char_data(mcs->mp_name, NULL, &value_handle,
# 1069|   						NULL, NULL, NULL))
# 1070|   		return;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def121]
bluez-5.79-build/bluez-5.79/src/shared/mcp.c: scope_hint: In function 'bt_mcp_track_changed_attach'
bluez-5.79-build/bluez-5.79/src/shared/mcp.c:1086:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
# 1084|   	struct bt_mcs *mcs = mcp_get_mcs(mcp);
# 1085|   
# 1086|-> 	if (!gatt_db_attribute_get_char_data(mcs->track_changed, NULL,
# 1087|   				&value_handle, NULL, NULL, NULL))
# 1088|   		return;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def122]
bluez-5.79-build/bluez-5.79/src/shared/mcp.c: scope_hint: In function 'bt_mcp_track_title_attach'
bluez-5.79-build/bluez-5.79/src/shared/mcp.c:1102:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
# 1100|   	struct bt_mcs *mcs = mcp_get_mcs(mcp);
# 1101|   
# 1102|-> 	if (!gatt_db_attribute_get_char_data(mcs->track_title, NULL,
# 1103|   				&value_handle, NULL, NULL, NULL))
# 1104|   		return;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def123]
bluez-5.79-build/bluez-5.79/src/shared/mcp.c: scope_hint: In function 'bt_mcp_track_duration_attach'
bluez-5.79-build/bluez-5.79/src/shared/mcp.c:1120:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
# 1118|   	struct bt_mcs *mcs = mcp_get_mcs(mcp);
# 1119|   
# 1120|-> 	if (!gatt_db_attribute_get_char_data(mcs->track_duration, NULL,
# 1121|   				&value_handle, NULL, NULL, NULL))
# 1122|   		return;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def124]
bluez-5.79-build/bluez-5.79/src/shared/mcp.c: scope_hint: In function 'bt_mcp_track_position_attach'
bluez-5.79-build/bluez-5.79/src/shared/mcp.c:1138:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
# 1136|   	struct bt_mcs *mcs = mcp_get_mcs(mcp);
# 1137|   
# 1138|-> 	if (!gatt_db_attribute_get_char_data(mcs->track_position, NULL,
# 1139|   				&value_handle, NULL, NULL, NULL))
# 1140|   		return;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def125]
bluez-5.79-build/bluez-5.79/src/shared/mcp.c: scope_hint: In function 'bt_mcp_media_state_attach'
bluez-5.79-build/bluez-5.79/src/shared/mcp.c:1156:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
# 1154|   	struct bt_mcs *mcs = mcp_get_mcs(mcp);
# 1155|   
# 1156|-> 	if (!gatt_db_attribute_get_char_data(mcs->media_state, NULL,
# 1157|   				&value_handle, NULL, NULL, NULL))
# 1158|   		return;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def126]
bluez-5.79-build/bluez-5.79/src/shared/mcp.c: scope_hint: In function 'bt_mcp_media_cp_attach'
bluez-5.79-build/bluez-5.79/src/shared/mcp.c:1174:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
# 1172|   	struct bt_mcs *mcs = mcp_get_mcs(mcp);
# 1173|   
# 1174|-> 	if (!gatt_db_attribute_get_char_data(mcs->media_cp, NULL,
# 1175|   				&value_handle, NULL, NULL, NULL))
# 1176|   		return;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def127]
bluez-5.79-build/bluez-5.79/src/shared/mcp.c: scope_hint: In function 'bt_mcp_media_cp_op_supported_attach'
bluez-5.79-build/bluez-5.79/src/shared/mcp.c:1190:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
# 1188|   	struct bt_mcs *mcs = mcp_get_mcs(mcp);
# 1189|   
# 1190|-> 	if (!gatt_db_attribute_get_char_data(mcs->media_cp_op_supportd, NULL,
# 1191|   				&value_handle, NULL, NULL, NULL))
# 1192|   		return;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def128]
bluez-5.79-build/bluez-5.79/src/shared/mcp.c: scope_hint: In function 'bt_mcp_content_control_id_supported_attach'
bluez-5.79-build/bluez-5.79/src/shared/mcp.c:1209:49: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
# 1207|   	struct bt_mcs *mcs = mcp_get_mcs(mcp);
# 1208|   
# 1209|-> 	if (!gatt_db_attribute_get_char_data(mcs->content_control_id, NULL,
# 1210|   				&value_handle, NULL, NULL, NULL))
# 1211|   		return;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def129]
bluez-5.79-build/bluez-5.79/src/shared/mcp.c: scope_hint: In function 'foreach_mcs_service'
bluez-5.79-build/bluez-5.79/src/shared/mcp.c:1376:22: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.79-build/bluez-5.79/src/shared/mcp.c:1374:9: note: in expansion of macro 'DBG'
bluez-5.79-build/bluez-5.79/src/shared/mcp.c:1374:9: note: in expansion of macro 'DBG'
# 1374|   	DBG(mcp, "");
# 1375|   
# 1376|-> 	mcs->service = attr;
# 1377|   
# 1378|   	gatt_db_service_foreach_char(attr, foreach_mcs_char, mcp);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def130]
bluez-5.79-build/bluez-5.79/src/shared/micp.c: scope_hint: In function 'micp_get_session'
bluez-5.79-build/bluez-5.79/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): [#def131]
bluez-5.79-build/bluez-5.79/src/shared/micp.c: scope_hint: In function 'mics_muted'
bluez-5.79-build/bluez-5.79/src/shared/micp.c:339:21: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.79-build/bluez-5.79/src/shared/micp.c: scope_hint: In function 'mics_muted'
bluez-5.79-build/bluez-5.79/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): [#def132]
bluez-5.79-build/bluez-5.79/src/shared/micp.c: scope_hint: In function 'mics_mute_write'
bluez-5.79-build/bluez-5.79/src/shared/micp.c:421:13: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.79-build/bluez-5.79/src/shared/micp.c: scope_hint: In function 'mics_mute_write'
bluez-5.79-build/bluez-5.79/src/shared/micp.c: scope_hint: In function 'mics_mute_write'
bluez-5.79-build/bluez-5.79/src/shared/micp.c: scope_hint: In function 'mics_mute_write'
#  419|   
#  420|   	mute_state = mdb_get_mute_state(mdb);
#  421|-> 	if (*mute_state == MICS_DISABLED) {
#  422|   		DBG(micp, "state: MICS DISABLED , can not write value: %d",
#  423|   				*micp_op);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def133]
bluez-5.79-build/bluez-5.79/src/shared/micp.c: scope_hint: In function 'foreach_mics_service'
bluez-5.79-build/bluez-5.79/src/shared/micp.c:786:23: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
#  784|   	struct bt_mics *mics = micp_get_mics(micp);
#  785|   
#  786|-> 	mics->service = attr;
#  787|   
#  788|   	gatt_db_service_set_claimed(attr, true);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def134]
bluez-5.79-build/bluez-5.79/src/shared/shell.c: scope_hint: In function 'bt_shell_printf'
bluez-5.79-build/bluez-5.79/src/shared/shell.c:738:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'saved_line'
bluez-5.79-build/bluez-5.79/src/shared/shell.c:29: included_from: Included from here.
#  736|   		if (!data.saved_prompt)
#  737|   			rl_restore_prompt();
#  738|-> 		rl_replace_line(saved_line, 0);
#  739|   		rl_point = saved_point;
#  740|   		rl_redisplay();

Error: GCC_ANALYZER_WARNING (CWE-476): [#def135]
bluez-5.79-build/bluez-5.79/src/shared/tester.c: scope_hint: In function 'tester_setup_io'
bluez-5.79-build/bluez-5.79/src/shared/tester.c:1041:19: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.79-build/bluez-5.79/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): [#def136]
bluez-5.79-build/bluez-5.79/src/shared/tester.c: scope_hint: In function 'tester_io_send'
bluez-5.79-build/bluez-5.79/src/shared/tester.c:1051:17: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.79-build/bluez-5.79/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): [#def137]
bluez-5.79-build/bluez-5.79/src/shared/tester.c: scope_hint: In function 'tester_io_set_complete_func'
bluez-5.79-build/bluez-5.79/src/shared/tester.c:1059:32: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-688): [#def138]
bluez-5.79-build/bluez-5.79/src/shared/util.c: scope_hint: In function 'util_iov_memcpy.part.0'
bluez-5.79-build/bluez-5.79/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): [#def139]
bluez-5.79-build/bluez-5.79/src/shared/util.c: scope_hint: In function 'strdelimit'
bluez-5.79-build/bluez-5.79/src/shared/util.c:1852:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'dup'
# 1850|   
# 1851|   	dup = strdup(str);
# 1852|-> 	if (dup[0] == '\0')
# 1853|   		return dup;
# 1854|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def140]
bluez-5.79-build/bluez-5.79/src/shared/util.h:60:12: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*(struct <anonymous> *)(&mic[0]).__v’
bluez-5.79-build/bluez-5.79/src/shared/util.h:240:16: note: in expansion of macro ‘be32_to_cpu’
bluez-5.79-build/bluez-5.79/src/shared/util.h:240:28: note: in expansion of macro ‘get_unaligned’
bluez-5.79-build/bluez-5.79/tools/mesh-gatt/crypto.c: scope_hint: In function ‘mesh_crypto_aes_ccm_decrypt’
bluez-5.79-build/bluez-5.79/src/shared/util.h:68:21: note: in definition of macro ‘put_unaligned’
bluez-5.79-build/bluez-5.79/src/shared/util.h:287:23: note: in expansion of macro ‘cpu_to_be32’
bluez-5.79-build/bluez-5.79/tools/mesh-gatt/crypto.c: scope_hint: In function ‘mesh_crypto_aes_ccm_decrypt’
bluez-5.79-build/bluez-5.79/tools/mesh-gatt/crypto.c: scope_hint: In function ‘mesh_crypto_aes_ccm_decrypt’
bluez-5.79-build/bluez-5.79/src/shared/util.h:240:16: note: in expansion of macro ‘be32_to_cpu’
bluez-5.79-build/bluez-5.79/src/shared/util.h:240:28: note: in expansion of macro ‘get_unaligned’
bluez-5.79-build/bluez-5.79/src/shared/util.h:240:16: note: in expansion of macro ‘be32_to_cpu’
bluez-5.79-build/bluez-5.79/src/shared/util.h:240: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): [#def141]
bluez-5.79-build/bluez-5.79/src/shared/util.h:68:18: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'data'
bluez-5.79-build/bluez-5.79/src/shared/util.h:260:9: note: in expansion of macro 'put_unaligned'
bluez-5.79-build/bluez-5.79/src/shared/gatt-db.c: scope_hint: In function 'gen_hash_m.part.0'
bluez-5.79-build/bluez-5.79/src/shared/util.h:260: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): [#def142]
bluez-5.79-build/bluez-5.79/src/shared/util.h:68:18: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pElem’
bluez-5.79-build/bluez-5.79/src/shared/util.h:265:9: note: in expansion of macro ‘put_unaligned’
bluez-5.79-build/bluez-5.79/src/sdpd-request.c: scope_hint: In function ‘extract_des’
bluez-5.79-build/bluez-5.79/src/sdpd-request.c: scope_hint: In function ‘extract_des’
bluez-5.79-build/bluez-5.79/src/sdpd-request.c: scope_hint: In function ‘extract_des’
bluez-5.79-build/bluez-5.79/src/shared/util.h:265: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): [#def143]
bluez-5.79-build/bluez-5.79/src/shared/util.c:39: included_from: Included from here.
bluez-5.79-build/bluez-5.79/src/shared/util.c: scope_hint: In function 'util_iov_dup'
bluez-5.79-build/bluez-5.79/src/shared/util.h:83:17: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
bluez-5.79-build/bluez-5.79/src/shared/util.c:350:15: note: in expansion of macro 'new0'
bluez-5.79-build/bluez-5.79/src/shared/util.c:350:15: note: in expansion of macro 'new0'
bluez-5.79-build/bluez-5.79/src/shared/util.c:350:15: note: in expansion of macro 'new0'
bluez-5.79-build/bluez-5.79/src/shared/util.c:350:15: note: in expansion of macro 'new0'
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-476): [#def144]
bluez-5.79-build/bluez-5.79/src/shared/vcp.c: scope_hint: In function 'vcp_get_session.part.0'
bluez-5.79-build/bluez-5.79/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): [#def145]
bluez-5.79-build/bluez-5.79/src/shared/vcp.c: scope_hint: In function 'aics_new'
bluez-5.79-build/bluez-5.79/src/shared/vcp.c:1733:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'ip_descr' where non-null expected
bluez-5.79-build/bluez-5.79/src/shared/vcp.c:22: included_from: Included from here.
bluez-5.79-build/bluez-5.79/src/shared/vcp.c:1728:16: note: in expansion of macro 'new0'
<built-in>: note: argument 1 of '__builtin_memset' must be non-null
# 1731|   	aics_gain_settng_prop = new0(struct gain_setting_prop, 1);
# 1732|   	ip_descr = malloc(256);
# 1733|-> 	memset(ip_descr, 0, 256);
# 1734|   
# 1735|   	aics_aud_ip_st->mute = AICS_NOT_MUTED;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def146]
bluez-5.79-build/bluez-5.79/src/shared/vcp.c: scope_hint: In function 'vcp_audio_loc_notify'
bluez-5.79-build/bluez-5.79/src/shared/vcp.c:1981:27: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'vocs_audio_loc_n'
# 1979|   {
# 1980|   	uint32_t *vocs_audio_loc_n = malloc(sizeof(uint32_t));
# 1981|-> 	*vocs_audio_loc_n = 0;
# 1982|   
# 1983|   	if (value != NULL)

Error: GCC_ANALYZER_WARNING (CWE-688): [#def147]
bluez-5.79-build/bluez-5.79/src/shared/vcp.c: scope_hint: In function 'aics_audio_ip_desr_notify'
bluez-5.79-build/bluez-5.79/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): [#def148]
bluez-5.79-build/bluez-5.79/src/shared/vcp.c: scope_hint: In function 'foreach_vcs_service'
bluez-5.79-build/bluez-5.79/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-666): [#def149]
bluez-5.79-build/bluez-5.79/tools/avinfo.c: scope_hint: In function ‘l2cap_connect’
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-666): [#def150]
bluez-5.79-build/bluez-5.79/tools/avtest.c: scope_hint: In function ‘do_connect’
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-479): [#def151]
bluez-5.79-build/bluez-5.79/tools/bneptest.c: scope_hint: In function ‘exit_handler’
bluez-5.79-build/bluez-5.79/tools/bneptest.c:483:9: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘printf’ from within signal handler
bluez-5.79-build/bluez-5.79/tools/bneptest.c:35: included_from: Included from here.
bluez-5.79-build/bluez-5.79/src/log.h:60:9: note: in expansion of macro ‘DBG_IDX’
bluez-5.79-build/bluez-5.79/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): [#def152]
bluez-5.79-build/bluez-5.79/tools/bneptest.c:490:9: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘exit’ from within signal handler
bluez-5.79-build/bluez-5.79/src/log.h:60:9: note: in expansion of macro ‘DBG_IDX’
bluez-5.79-build/bluez-5.79/tools/bneptest.c:555:9: note: in expansion of macro ‘DBG’
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-775): [#def153]
bluez-5.79-build/bluez-5.79/tools/btsnoop.c: scope_hint: In function ‘command_merge’
bluez-5.79-build/bluez-5.79/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.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-666): [#def154]
bluez-5.79-build/bluez-5.79/tools/cltest.c: scope_hint: In function ‘send_message’
bluez-5.79-build/bluez-5.79/tools/cltest.c:62:13: warning[-Wanalyzer-fd-phase-mismatch]: ‘connect’ on file descriptor ‘fd’ in wrong phase
bluez-5.79-build/bluez-5.79/tools/cltest.c:26: included_from: Included from here.
bluez-5.79-build/bluez-5.79/tools/cltest.c:249:33: note: in expansion of macro ‘BDADDR_ANY’
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-688): [#def155]
bluez-5.79-build/bluez-5.79/tools/create-image.c: scope_hint: In function ‘write_block’
bluez-5.79-build/bluez-5.79/tools/create-image.c:108:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fp’ where non-null expected
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-476): [#def156]
bluez-5.79-build/bluez-5.79/tools/hciattach.c: scope_hint: In function ‘main’
bluez-5.79-build/bluez-5.79/tools/hciattach.c:1322:34: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘u’
# 1320|   
# 1321|   		case 2:
# 1322|-> 			u->speed = atoi(argv[optind]);
# 1323|   			break;
# 1324|   

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

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

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

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

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

Error: GCC_ANALYZER_WARNING (CWE-775): [#def162]
bluez-5.79-build/bluez-5.79/tools/hciattach_qualcomm.c: scope_hint: In function ‘qualcomm_load_firmware’
bluez-5.79-build/bluez-5.79/tools/hciattach_qualcomm.c:93:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(firmware, 0)’
bluez-5.79-build/bluez-5.79/tools/hciattach_qualcomm.c:95:9: note: in expansion of macro ‘FAILIF’
bluez-5.79-build/bluez-5.79/tools/hciattach_qualcomm.c:95:9: note: in expansion of macro ‘FAILIF’
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-775): [#def163]
bluez-5.79-build/bluez-5.79/tools/hciattach_tialt.c: scope_hint: In function ‘texas_load_firmware’
bluez-5.79-build/bluez-5.79/tools/hciattach_tialt.c:95:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(firmware, 0)’
bluez-5.79-build/bluez-5.79/tools/hciattach_tialt.c:97:9: note: in expansion of macro ‘FAILIF’
bluez-5.79-build/bluez-5.79/tools/hciattach_tialt.c:97:9: note: in expansion of macro ‘FAILIF’
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-401): [#def164]
bluez-5.79-build/bluez-5.79/tools/hcidump.c: scope_hint: In function ‘process_frames’
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-476): [#def165]
bluez-5.79-build/bluez-5.79/tools/iso-tester.c: scope_hint: In function ‘listen_iso_sock’
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-476): [#def166]
bluez-5.79-build/bluez-5.79/tools/isotest.c: scope_hint: In function ‘do_listen’
bluez-5.79-build/bluez-5.79/tools/isotest.c:519:26: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘addr’
bluez-5.79-build/bluez-5.79/tools/isotest.c:17: included_from: Included from here.
#  517|   	addr = malloc(sizeof(*addr) + sizeof(*addr->iso_bc));
#  518|   	memset(addr, 0, sizeof(*addr) + sizeof(*addr->iso_bc));
#  519|-> 	addr->iso_family = AF_BLUETOOTH;
#  520|   	bacpy(&addr->iso_bdaddr, mgmt_index != MGMT_INDEX_NONE ?
#  521|   					&bdaddr : BDADDR_ANY);

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

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

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

Error: GCC_ANALYZER_WARNING (CWE-457): [#def170]
bluez-5.79-build/bluez-5.79/tools/mesh-gatt/crypto.c: scope_hint: In function ‘mesh_crypto_aes_ccm_encrypt’
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-775): [#def171]
bluez-5.79-build/bluez-5.79/tools/mesh-gatt/prov-db.c: scope_hint: In function ‘prov_file_read’
bluez-5.79-build/bluez-5.79/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 (CWE-457): [#def172]
bluez-5.79-build/bluez-5.79/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 (CWE-457): [#def173]
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-476): [#def174]
/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.79-build/bluez-5.79/tools/mpris-proxy.c:26: included_from: Included from here.
bluez-5.79-build/bluez-5.79/tools/mpris-proxy.c: scope_hint: In function ‘mpris_busname’
bluez-5.79-build/bluez-5.79/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.79-build/bluez-5.79/tools/mpris-proxy.c:1967:27: note: in expansion of macro ‘g_strdup’
bluez-5.79-build/bluez-5.79/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.79-build/bluez-5.79/tools/mpris-proxy.c: scope_hint: In function ‘mpris_busname’
/usr/include/glib-2.0/glib/gmem.h:335:57: note: in expansion of macro ‘_G_NEW’
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-688): [#def175]
bluez-5.79-build/bluez-5.79/tools/obex-server-tool.c: scope_hint: In function ‘handle_put’
bluez-5.79-build/bluez-5.79/tools/obex-server-tool.c:133:20: warning[-Wanalyzer-null-argument]: use of NULL ‘name’ where non-null expected
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-688): [#def176]
bluez-5.79-build/bluez-5.79/tools/obex-server-tool.c: scope_hint: In function ‘handle_get’
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-476): [#def177]
bluez-5.79-build/bluez-5.79/tools/parser/amp.c:15: included_from: Included from here.
bluez-5.79-build/bluez-5.79/tools/parser/parser.h: scope_hint: In function ‘p_indent’
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING: [#def178]
bluez-5.79-build/bluez-5.79/tools/rfcomm-tester.c: scope_hint: In function ‘create_rfcomm_sock’
bluez-5.79-build/bluez-5.79/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): [#def179]
bluez-5.79-build/bluez-5.79/tools/rfcomm-tester.c: scope_hint: In function ‘connect_rfcomm_sock’
bluez-5.79-build/bluez-5.79/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: [#def180]
bluez-5.79-build/bluez-5.79/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): [#def181]
bluez-5.79-build/bluez-5.79/tools/rfcomm-tester.c: scope_hint: In function ‘rfcomm_listen_cb’
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-775): [#def182]
bluez-5.79-build/bluez-5.79/tools/rfcomm.c: scope_hint: In function ‘cmd_connect’
bluez-5.79-build/bluez-5.79/tools/rfcomm.c:354:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&devname, 256)’
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-775): [#def183]
bluez-5.79-build/bluez-5.79/tools/rfcomm.c: scope_hint: In function ‘cmd_listen’
bluez-5.79-build/bluez-5.79/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: GCC_ANALYZER_WARNING (CWE-775): [#def184]
bluez-5.79-build/bluez-5.79/tools/sco-tester.c: scope_hint: In function ‘create_sco_sock’
bluez-5.79-build/bluez-5.79/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): [#def185]
bluez-5.79-build/bluez-5.79/tools/sco-tester.c: scope_hint: In function ‘connect_sco_sock’
bluez-5.79-build/bluez-5.79/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 (CWE-457): [#def186]
bluez-5.79-build/bluez-5.79/tools/test-runner.c:951: warning[uninitvar]: Uninitialized variable: argv
#  949|   	envp[pos] = NULL;
#  950|   
#  951|-> 	printf("Running command %s\n", cmdname ? cmdname : argv[0]);
#  952|   
#  953|   	pid = fork();

Scan Properties

analyzer-version-clippy1.82.0
analyzer-version-cppcheck2.16.0
analyzer-version-gcc14.2.1
analyzer-version-gcc-analyzer15.0.0
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-225.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-namebluez-5.79-1.fc42
store-results-to/tmp/tmplki9ox_9/bluez-5.79-1.fc42.tar.xz
time-created2024-11-12 23:24:30
time-finished2024-11-12 23:29:08
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmplki9ox_9/bluez-5.79-1.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmplki9ox_9/bluez-5.79-1.fc42.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9