From 5354226e5960c2beb7b1ef7adaae8631328978f7 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 22 Jun 2018 09:36:20 +1000 Subject: [PATCH] util: use assert() instead of abort() for testing for size limits This way we can send a message to the user, a simple abort() isn't informative enough. Fixes https://gitlab.freedesktop.org/libinput/libinput/issues/54 Signed-off-by: Peter Hutterer --- src/libinput-util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libinput-util.h b/src/libinput-util.h index 720f388b..fadf11c2 100644 --- a/src/libinput-util.h +++ b/src/libinput-util.h @@ -145,7 +145,7 @@ zalloc(size_t size) /* We never need to alloc anything more than 1,5 MB so we can assume * if we ever get above that something's going wrong */ if (size > 1536 * 1024) - abort(); + assert(!"bug: internal malloc size limit exceeded"); p = calloc(1, size); if (!p)