Skip to content
Snippets Groups Projects
Commit 8ca1b9dc authored by John Baldwin's avatar John Baldwin
Browse files

devel/gdb: Avoid a divide by zero in kgdb.

Don't divide by zero if the message buffer size in a crashdump is
zero.

Reported by:	glebius
Reviewed by:	pizzamig (maintainer), emaste
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D32486
parent a950db78
No related merge requests found
......@@ -2,6 +2,7 @@
PORTNAME= gdb
DISTVERSION= 11.1
PORTREVISION= 1
CATEGORIES= devel
MASTER_SITES= GNU
......
......@@ -144,6 +144,8 @@ kgdb_dmesg(void)
} catch (const gdb_exception_error &e) {
return;
}
if (size == 0)
return;
rseq = MSGBUF_SEQ_TO_POS(size, rseq);
wseq = MSGBUF_SEQ_TO_POS(size, wseq);
if (rseq == wseq)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment