On 3/20/21 7:37 AM, Alex Bennée wrote:
+ if (info.heap_base == NULL || info.heap_limit == NULL) {
+ printf("null heap: %p -> %p\n", info.heap_base, info.heap_limit);
+ exit(1);
+ } else if (info.heap_base != NULL && info.heap_limit != NULL) {
Useless inversion of first test?
+ if (info.stack_base == NULL) {
+ printf("null stack: %p -> %p\n", info.stack_base, info.stack_limit);
+ exit(3);
+ } else if (info.stack_base != NULL && info.stack_limit != NULL) {
So... we're expecting stack_limit unset is valid?
Perhaps a check that stack and heap do not intersect?
Perhaps a check that &info is within the stack bounds?
r~