diff options
author | daan <daanl@outlook.com> | 2020-01-29 17:25:40 -0800 |
---|---|---|
committer | daan <daanl@outlook.com> | 2020-01-29 17:25:40 -0800 |
commit | 7ff3ec2bf74b9014279103a55b632df182dacc7c (patch) | |
tree | 42377366bffe986fdd84fa050b0cb6a34d0f6633 /src/options.c | |
parent | 5d212d688f82a3b17f00faa11967e9459dc78715 (diff) |
use EFAULT for buffer overflow and call abort in debug mode (as well as secure mode)
Diffstat (limited to 'src/options.c')
-rw-r--r-- | src/options.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/options.c b/src/options.c index af051aa..7559a4b 100644 --- a/src/options.c +++ b/src/options.c @@ -319,6 +319,14 @@ static volatile _Atomic(void*) mi_error_arg; // = NULL static void mi_error_default(int err) { UNUSED(err); +#if (MI_DEBUG>0) + if (err==EFAULT) { + #ifdef _MSC_VER + __debugbreak(); + #endif + abort(); + } +#endif #if (MI_SECURE>0) if (err==EFAULT) { // abort on serious errors in secure mode (corrupted meta-data) abort(); |