[PATCH] monitor: Fix possible crash on unknown command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If uknown command is received monitor would crash due to dereference
of NULL opcode_data pointer.
---
 monitor/packet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/monitor/packet.c b/monitor/packet.c
index 19139f8..58a5a97 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -4266,7 +4266,7 @@ static void cmd_complete_evt(const void *data, uint8_t size)
 	print_indent(6, opcode_color, "", opcode_str, COLOR_OFF,
 			" (0x%2.2x|0x%4.4x) ncmd %d", ogf, ocf, evt->ncmd);
 
-	if (!opcode_data->rsp_func) {
+	if (!opcode_data || !opcode_data->rsp_func) {
 		packet_hexdump(data + 3, size - 3);
 		return;
 	}
-- 
1.8.0.3

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux