Diff between c6655ce871d4c963c11cab5408fab74e12bfc008 and e97975afd1e051d77acd870b4f0736b7aac5f60d

Changed Files

File Additions Deletions Status
monitor/lmp.c +5 -0 modified

Full Patch

diff --git a/monitor/lmp.c b/monitor/lmp.c
index d246776..e7e6b25 100644
--- a/monitor/lmp.c
+++ b/monitor/lmp.c
@@ -852,6 +852,11 @@ void lmp_packet(const void *data, uint8_t size, bool padded)
 
 	switch (opcode) {
 	case 127:
+		if (size < 2) {
+			print_text(COLOR_ERROR, "extended opcode too short");
+			packet_hexdump(data, size);
+			return;
+		}
 		opcode = LMP_ESC4(((const uint8_t *) data)[1]);
 		off = 2;
 		break;