diff --git a/file-f042050f.patch b/file-f042050f.patch new file mode 100644 index 0000000..38edc41 --- /dev/null +++ b/file-f042050f.patch @@ -0,0 +1,61 @@ +From f042050f59bfc037677871c4d1037c33273f5213 Mon Sep 17 00:00:00 2001 +From: Christos Zoulas +Date: Mon, 4 Jul 2022 22:30:51 +0000 +Subject: [PATCH] mbrlen(NULL, is not portable; revert to using memset to + initialize the state. + +--- + src/file.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git src/file.c src/file.c +index af9be0f0..8b4f14c2 100644 +--- src/file.c ++++ src/file.c +|@@ -32,7 +32,7 @@ +| #include "file.h" +| +| #ifndef lint +|-FILE_RCSID("@(#)$File: file.c,v 1.198 2022/07/04 20:16:29 christos Exp $") +|+FILE_RCSID("@(#)$File: file.c,v 1.199 2022/07/04 22:30:51 christos Exp $") +| #endif /* lint */ +| +| #include "magic.h" +@@ -575,14 +575,14 @@ fname_print(const char *inname) + size_t bytesconsumed; + + +- (void)mbrlen(NULL, 0, &state); ++ (void)memset(&state, 0, sizeof(state)); + while (n > 0) { + bytesconsumed = mbrtowc(&nextchar, inname, n, &state); + if (bytesconsumed == CAST(size_t, -1) || + bytesconsumed == CAST(size_t, -2)) { + nextchar = *inname++; + n--; +- (void)mbrlen(NULL, 0, &state); ++ (void)memset(&state, 0, sizeof(state)); + file_octal(CAST(unsigned char, nextchar)); + continue; + } +@@ -654,7 +654,7 @@ file_mbswidth(struct magic_set *ms, const char *s) + mbstate_t state; + wchar_t nextchar; + +- (void)mbrlen(NULL, 0, &state); ++ (void)memset(&state, 0, sizeof(state)); + n = strlen(s); + + while (n > 0) { +@@ -663,7 +663,7 @@ file_mbswidth(struct magic_set *ms, const char *s) + bytesconsumed == CAST(size_t, -2)) { + nextchar = *s; + bytesconsumed = 1; +- (void)mbrlen(NULL, 0, &state); ++ (void)memset(&state, 0, sizeof(state)); + width += 4; + } else { + width += ((ms->flags & MAGIC_RAW) != 0 +-- +2.35.3 + diff --git a/file.changes b/file.changes index 279badc..bb8bdde 100644 --- a/file.changes +++ b/file.changes @@ -4,6 +4,7 @@ Wed Jul 13 11:01:16 UTC 2022 - Dr. Werner Fink - Add upstream patches to fix boo#1201350 * file-7e59d342.patch * file-c80065fe.patch + * file-f042050f.patch ------------------------------------------------------------------- Mon Jun 13 08:45:48 UTC 2022 - Dr. Werner Fink diff --git a/file.spec b/file.spec index ee7bcbc..61d37c6 100644 --- a/file.spec +++ b/file.spec @@ -65,6 +65,7 @@ Patch39: file-5.28-btrfs-image.dif # Upstream commits as patches Patch42: file-c80065fe.patch Patch43: file-7e59d342.patch +Patch44: file-f042050f.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %global _sysconfdir /etc %global _miscdir %{_datadir}/misc @@ -110,6 +111,7 @@ to develop applications that require the magic "file" interface. %setup -q -n file-%{version} %patch42 -p0 %patch43 -p0 +%patch44 -p0 %patch1 -p0 -b .misc %patch4 -p0 -b .conf %patch5 -p0 -b .tex