except: detect exception stack corruption
Valgrind found an invalid read in the capture from Bug 15173 which was not detected by ASAN, probably because 'top' pointed to a valid stack address. Try to catch such issues with an explicit invariant check. Change-Id: I3e2d90f053209c133ea2edc9c7990a2fd39bd236 Ping-Bug: 15189 Reviewed-on: https://code.wireshark.org/review/30101 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
parent
353ad11974
commit
9c61757dc2
|
@ -260,6 +260,7 @@ void except_setup_try(struct except_stacknode *esn,
|
||||||
struct except_stacknode *except_pop(void)
|
struct except_stacknode *except_pop(void)
|
||||||
{
|
{
|
||||||
struct except_stacknode *top = get_top();
|
struct except_stacknode *top = get_top();
|
||||||
|
assert (top->except_type == XCEPT_CLEANUP || top->except_type == XCEPT_CATCHER);
|
||||||
set_top(top->except_down);
|
set_top(top->except_down);
|
||||||
return top;
|
return top;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue