diff options
-rw-r--r-- | sys/gdb/gdb_main.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/gdb/gdb_main.c b/sys/gdb/gdb_main.c index 77233a2..9e361c8 100644 --- a/sys/gdb/gdb_main.c +++ b/sys/gdb/gdb_main.c @@ -154,7 +154,10 @@ gdb_trap(int type, int code) intmax_t tid; struct thread *thr; gdb_rx_char(); - gdb_rx_varhex(&tid); + if (gdb_rx_varhex(&tid)) { + gdb_tx_err(EINVAL); + break; + } if (tid > 0) { thr = kdb_thr_lookup(tid); if (thr == NULL) { @@ -255,7 +258,10 @@ gdb_trap(int type, int code) } case 'T': { /* Thread alive. */ intmax_t tid; - gdb_rx_varhex(&tid); + if (gdb_rx_varhex(&tid)) { + gdb_tx_err(EINVAL); + break; + } if (kdb_thr_lookup(tid) != NULL) gdb_tx_ok(); else |