mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-05 09:14:03 +00:00
Try to avoid a possible infinite loop when parsing an invalid kernel dump file.
PR: 108229 Submitted by: Jessica Han <jessicah juniper net> Reviewed by: marcel MFC after: 1 week
This commit is contained in:
parent
6c125b8df6
commit
c4b1628e07
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=166214
@ -104,12 +104,17 @@ kgdb_thr_init(void)
|
||||
stoppcbs = lookup("_stoppcbs");
|
||||
|
||||
while (paddr != 0) {
|
||||
if (kvm_read(kvm, paddr, &p, sizeof(p)) != sizeof(p))
|
||||
if (kvm_read(kvm, paddr, &p, sizeof(p)) != sizeof(p)) {
|
||||
warnx("kvm_read: %s", kvm_geterr(kvm));
|
||||
break;
|
||||
}
|
||||
addr = (uintptr_t)TAILQ_FIRST(&p.p_threads);
|
||||
while (addr != 0) {
|
||||
if (kvm_read(kvm, addr, &td, sizeof(td)) != sizeof(td))
|
||||
if (kvm_read(kvm, addr, &td, sizeof(td)) !=
|
||||
sizeof(td)) {
|
||||
warnx("kvm_read: %s", kvm_geterr(kvm));
|
||||
break;
|
||||
}
|
||||
kt = malloc(sizeof(*kt));
|
||||
kt->next = first;
|
||||
kt->kaddr = addr;
|
||||
|
Loading…
Reference in New Issue
Block a user