Thread (2 messages) 2 messages, 2 authors, 2013-01-21
STALE4933d

[PATCH] monitor: Fix possible crash on unknown command

From: Szymon Janc <hidden>
Date: 2013-01-21 15:17:47
Subsystem: the rest · Maintainer: Linus Torvalds

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help