summaryrefslogtreecommitdiffstats
path: root/src/boot/efi/efi-string.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 03:50:45 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 03:50:45 +0000
commitefeb864cb547a2cbf96dc0053a8bdb4d9190b364 (patch)
treec0b83368f18be983fcc763200c4c24d633244588 /src/boot/efi/efi-string.c
parentReleasing progress-linux version 255.5-1~progress7.99u1. (diff)
downloadsystemd-efeb864cb547a2cbf96dc0053a8bdb4d9190b364.tar.xz
systemd-efeb864cb547a2cbf96dc0053a8bdb4d9190b364.zip
Merging upstream version 256.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/boot/efi/efi-string.c')
-rw-r--r--src/boot/efi/efi-string.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/boot/efi/efi-string.c b/src/boot/efi/efi-string.c
index 4144c0d..3bdb802 100644
--- a/src/boot/efi/efi-string.c
+++ b/src/boot/efi/efi-string.c
@@ -372,9 +372,9 @@ bool efi_fnmatch(const char16_t *pattern, const char16_t *haystack) {
\
uint64_t u = 0; \
while (*s >= '0' && *s <= '9') { \
- if (__builtin_mul_overflow(u, 10, &u)) \
+ if (!MUL_ASSIGN_SAFE(&u, 10)) \
return false; \
- if (__builtin_add_overflow(u, *s - '0', &u)) \
+ if (!INC_SAFE(&u, *s - '0')) \
return false; \
s++; \
} \
@@ -593,13 +593,13 @@ typedef struct {
static void grow_buf(FormatContext *ctx, size_t need) {
assert(ctx);
- assert_se(!__builtin_add_overflow(ctx->n, need, &need));
+ assert_se(INC_SAFE(&need, ctx->n));
if (need < ctx->n_buf)
return;
/* Greedily allocate if we can. */
- if (__builtin_mul_overflow(need, 2, &ctx->n_buf))
+ if (!MUL_SAFE(&ctx->n_buf, need, 2))
ctx->n_buf = need;
/* We cannot use realloc here as ctx->buf may be ctx->stack_buf, which we cannot free. */