check return value of gdb_rx_varhex

Noticed by:	Coverity Prevent analysis tool
Reviewed by:	kan
This commit is contained in:
Sam Leffler 2005-03-28 18:31:18 +00:00
parent a89017c846
commit 4af77ece56

View File

@ -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