public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/xevd] rawhide: Fix build on i686
@ 2026-08-10 14:39 Simone Caronni
  0 siblings, 0 replies; only message in thread
From: Simone Caronni @ 2026-08-10 14:39 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/xevd
Branch : rawhide
Commit : ba8fb3fa8297f91ae13970d08c4df0733ecefc1a
Author : Simone Caronni <negativo17@gmail.com>
Date   : 2026-08-10T16:39:22+02:00
Stats  : +46/-0 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/xevd/c/ba8fb3fa8297f91ae13970d08c4df0733ecefc1a?branch=rawhide

Log:
Fix build on i686

---
diff --git a/xevd-0.7.0-format-overflow.patch b/xevd-0.7.0-format-overflow.patch
new file mode 100644
index 0000000..2d33e38
--- /dev/null
+++ b/xevd-0.7.0-format-overflow.patch
@@ -0,0 +1,45 @@
+From: Simone Caronni <negativo17@gmail.com>
+Subject: [PATCH] Avoid buffer overflows in the trace line helpers
+
+xevd_trace_line() and log_line() copy a caller supplied string of unknown
+length into a fixed 128 byte buffer with sprintf(), which GCC diagnoses as a
+potential format overflow. Upstream builds with -Werror, so this breaks the
+build on i686.
+
+Use snprintf() with an explicit precision, so the copy is bounded both by the
+size of the destination buffer and by the line width the helpers pad to, and
+only write the terminating NUL when it still falls inside the buffer.
+
+--- a/src_base/xevd_port.c
++++ b/src_base/xevd_port.c
+@@ -49,10 +49,10 @@
+     int len = (pre == NULL) ? 0 : (int)strlen(pre);
+     if (len > 0)
+     {
+-        sprintf(str, "%s ", pre);
++        snprintf(str, sizeof(str), "%.*s ", chars - 1, pre);
+         len = (int)strlen(str);
+     }
+     for (int i = len; i < chars; i++) { str[i] = '='; }
+-    str[chars] = '\0';
++    if (len < chars) { str[chars] = '\0'; }
+     printf("%s\n", str);
+ }
+\ No newline at end of file
+--- a/app/xevd_app_util.h
++++ b/app/xevd_app_util.h
+@@ -67,12 +67,12 @@
+     len = (pre == NULL)? 0: (int)strlen(pre);
+     if(len > 0)
+     {
+-        sprintf(str + 3, " %s ", pre);
++        snprintf(str + 3, sizeof(str) - 3, " %.*s ", chars - 5, pre);
+         len = (int)strlen(str);
+     }
+ 
+     for(i = len ; i< chars; i++) {str[i] = '=';}
+-    str[chars] = '\0';
++    if(len < chars) {str[chars] = '\0';}
+     printf("%s\n", str);
+ }
+ 

diff --git a/xevd.spec b/xevd.spec
index 4012f61..40a08d8 100644
--- a/xevd.spec
+++ b/xevd.spec
@@ -9,6 +9,7 @@ URL:            https://github.com/mpeg5/xevd
 Source0:        %{name}-free-%{version}.tar.gz
 # Script to generate tarball with unencumbered sources
 Source1:        %{name}_gen_free_tarball.sh
+Patch0:         %{name}-%{version}-format-overflow.patch
 
 BuildRequires:  cmake >= 3.12
 BuildRequires:  gcc

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-10 14:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-10 14:39 [rpms/xevd] rawhide: Fix build on i686 Simone Caronni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox