* [PATCH] monitor: Fix possible crash on unknown command
@ 2013-01-21 15:17 Szymon Janc
2013-01-21 19:39 ` Marcel Holtmann
0 siblings, 1 reply; 2+ messages in thread
From: Szymon Janc @ 2013-01-21 15:17 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Szymon Janc
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-01-21 19:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-21 15:17 [PATCH] monitor: Fix possible crash on unknown command Szymon Janc
2013-01-21 19:39 ` Marcel Holtmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox