]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
basic: use assert_se in alloca_safe()
authorLuca Boccassi <luca.boccassi@gmail.com>
Thu, 11 Jun 2026 19:12:57 +0000 (20:12 +0100)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 12 Jun 2026 09:21:58 +0000 (11:21 +0200)
Ensure it cannot get compiled out regardless of build options

Follow-up for 9e1a759903a3ff9943334d25de19b06afc40c11e

Assisted-by: kres (claude-opus-4-7)
src/basic/alloc-util.h

index 2c40c4771cdc3b289b365c2828e5001c46f03ead..a3e2321b30349e3414c52213882ebe1f5fe1fe0c 100644 (file)
@@ -21,7 +21,7 @@
 #define alloca_safe(n)                                                  \
         ({                                                              \
                 size_t _nn_ = (n);                                      \
-                assert(_nn_ <= ALLOCA_MAX);                             \
+                assert_se(_nn_ <= ALLOCA_MAX);                          \
                 alloca(_nn_ == 0 ? 1 : _nn_);                           \
         })                                                              \