summaryrefslogtreecommitdiffstats
path: root/sys/gdb
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2005-03-28 18:31:18 +0000
committersam <sam@FreeBSD.org>2005-03-28 18:31:18 +0000
commite5a103489f7b517da7e896b169b04b5861a3e589 (patch)
tree8b74e68b233aa514f742e5146497e5426c0f5997 /sys/gdb
parentf37742ff8923aa4bde92d9f9cfd4b77514fb2662 (diff)
downloadFreeBSD-src-e5a103489f7b517da7e896b169b04b5861a3e589.zip
FreeBSD-src-e5a103489f7b517da7e896b169b04b5861a3e589.tar.gz
check return value of gdb_rx_varhex
Noticed by: Coverity Prevent analysis tool Reviewed by: kan
Diffstat (limited to 'sys/gdb')
-rw-r--r--sys/gdb/gdb_main.c10
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
OpenPOWER on IntegriCloud