projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fa5d277
)
efi: add assert to silence coverity
author
Luca Boccassi
<bluca@debian.org>
Sat, 15 Jul 2023 23:39:13 +0000
(
00:39
+0100)
committer
Luca Boccassi
<bluca@debian.org>
Sat, 15 Jul 2023 23:39:13 +0000
(
00:39
+0100)
CID#
1502668
src/boot/efi/efi-string.c
patch
|
blob
|
history
diff --git
a/src/boot/efi/efi-string.c
b/src/boot/efi/efi-string.c
index 440059125596d9e04a5ecf8e7cbe94f9acc9ba69..ffe855245304795641e9ed69a6e1f3954e25913e 100644
(file)
--- a/
src/boot/efi/efi-string.c
+++ b/
src/boot/efi/efi-string.c
@@
-544,9
+544,11
@@
static bool push_str(FormatContext *ctx, SpecifierContext *sp) {
if (sp->wstr && sizeof(wchar_t) == sizeof(char16_t)) {
memcpy(ctx->buf + ctx->n, sp->wstr, sp->len * sizeof(*sp->wstr));
ctx->n += sp->len;
- } else
+ } else {
+ assert(sp->str || sp->wstr);
for (size_t i = 0; i < sp->len; i++)
ctx->buf[ctx->n++] = sp->str ? sp->str[i] : sp->wstr[i];
+ }
if (sp->align_left)
push_padding(ctx, ' ', sp->padded_len);