Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] package/safeclib: fix build with gcc-14.x
@ 2026-01-10 13:39 Bernd Kuhls
  2026-01-10 13:39 ` [Buildroot] [PATCH 2/2] package/safeclib: bump version to 3.9.1 Bernd Kuhls
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Bernd Kuhls @ 2026-01-10 13:39 UTC (permalink / raw)
  To: buildroot; +Cc: Fabrice Fontaine

Backported two upstream patches to fix build errors introduced by the
bump of gcc to 14.x.

Renamed patch 0001 to prepare its removal with the upcoming version bump
of safelib, added Upstream: tag.

Fixes:
https://autobuild.buildroot.net/results/af6/af65e6386439098ddf706ca43e99320cf5e9fd80/

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
 .checkpackageignore                           |  1 -
 ...snprintf_s-Increase-Buffer-Size-by-1.patch | 51 +++++++++++++++++++
 ...snprintf_s-Increase-Buffer-Size-by-1.patch | 49 ++++++++++++++++++
 ...3-fix-armv7-asm-inline-error-GH-115.patch} |  4 +-
 4 files changed, 102 insertions(+), 3 deletions(-)
 create mode 100644 package/safeclib/0001-vsnprintf_s-Increase-Buffer-Size-by-1.patch
 create mode 100644 package/safeclib/0002-vsnprintf_s-Increase-Buffer-Size-by-1.patch
 rename package/safeclib/{0001-fix-armv7-asm-inline-error-GH-115.patch => 0003-fix-armv7-asm-inline-error-GH-115.patch} (98%)

diff --git a/.checkpackageignore b/.checkpackageignore
index ad02938884..2502803da3 100644
--- a/.checkpackageignore
+++ b/.checkpackageignore
@@ -873,7 +873,6 @@ package/rubix/0001-dont-use-legacy-functions.patch lib_patch.Upstream
 package/rubix/0002-misc-fixes.patch lib_patch.Sob lib_patch.Upstream
 package/rygel/S99rygel Shellcheck lib_sysv.Indent lib_sysv.Variables
 package/s6-linux-init/0001-configure-add-D_GNU_SOURCE.patch lib_patch.Upstream
-package/safeclib/0001-fix-armv7-asm-inline-error-GH-115.patch lib_patch.Upstream
 package/samba4/0001-build-find-pre-built-heimdal-build-tools-in-case-of-.patch lib_patch.Upstream
 package/samba4/0002-ldap_message_test.c-include-stdint.h-before-cmoka.h.patch lib_patch.Upstream
 package/samba4/S91smb Shellcheck lib_sysv.Indent lib_sysv.Variables
diff --git a/package/safeclib/0001-vsnprintf_s-Increase-Buffer-Size-by-1.patch b/package/safeclib/0001-vsnprintf_s-Increase-Buffer-Size-by-1.patch
new file mode 100644
index 0000000000..eae11dcc0d
--- /dev/null
+++ b/package/safeclib/0001-vsnprintf_s-Increase-Buffer-Size-by-1.patch
@@ -0,0 +1,51 @@
+From 62051f9761f92dc99c8ce0552239ad10e2062168 Mon Sep 17 00:00:00 2001
+From: Bernd Kuhls <bernd@kuhls.net>
+Date: Sat, 10 Jan 2026 12:16:22 +0100
+Subject: [PATCH] vsnprintf_s: Increase Buffer Size by 1
+
+Another fix similar to https://github.com/rurban/safeclib/commit/f59a0c8c1b5cf19cd0ed7f9bfb3a1e85f54113d0
+
+In function 'safec_ntoa_format',
+    inlined from 'safec_ntoa_long' at str/vsnprintf_s.c:331:12:
+str/vsnprintf_s.c:256:24: error: writing 32 bytes into a region of size 0 [-Werror=stringop-overflow=]
+  256 |             buf[len++] = '0';
+      |             ~~~~~~~~~~~^~~~~
+str/vsnprintf_s.c: In function 'safec_ntoa_long':
+str/vsnprintf_s.c:312:10: note: at offset 32 into destination object 'buf' of size 32
+  312 |     char buf[PRINTF_NTOA_BUFFER_SIZE];
+      |          ^~~
+In function 'safec_ntoa_format',
+    inlined from 'safec_ntoa_long' at str/vsnprintf_s.c:331:12:
+str/vsnprintf_s.c:260:24: error: writing 32 bytes into a region of size 0 [-Werror=stringop-overflow=]
+  260 |             buf[len++] = '0';
+      |             ~~~~~~~~~~~^~~~~
+str/vsnprintf_s.c: In function 'safec_ntoa_long':
+str/vsnprintf_s.c:312:10: note: at offset 32 into destination object 'buf' of size 32
+  312 |     char buf[PRINTF_NTOA_BUFFER_SIZE];
+      |          ^~~
+cc1: all warnings being treated as errors
+
+Upstream: https://github.com/rurban/safeclib/pull/150
+
+[backported to version 3.7.1]
+Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
+---
+ src/str/vsnprintf_s.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/str/vsnprintf_s.c b/src/str/vsnprintf_s.c
+index 59dbda94..ca838df1 100644
+--- a/src/str/vsnprintf_s.c
++++ b/src/str/vsnprintf_s.c
+@@ -296,7 +296,7 @@ static size_t safec_ntoa_long(out_fct_type out,  const char *funcname,
+                               unsigned long base, unsigned int prec,
+                               unsigned int width, unsigned int flags)
+ {
+-    char buf[PRINTF_NTOA_BUFFER_SIZE];
++    char buf[PRINTF_NTOA_BUFFER_SIZE + 1];
+     size_t len = 0U;
+ 
+     // no hash for 0 values
+-- 
+2.47.3
+
diff --git a/package/safeclib/0002-vsnprintf_s-Increase-Buffer-Size-by-1.patch b/package/safeclib/0002-vsnprintf_s-Increase-Buffer-Size-by-1.patch
new file mode 100644
index 0000000000..2dabebf3b2
--- /dev/null
+++ b/package/safeclib/0002-vsnprintf_s-Increase-Buffer-Size-by-1.patch
@@ -0,0 +1,49 @@
+From dea3c2e1aa1b775baa690b9ef40239f881c5f068 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 13 Aug 2025 20:23:48 -0700
+Subject: [PATCH] vsnprintf_s: Increase Buffer Size by 1
+
+It is a buffer overflow warning that GCC 15.2 is catching.
+The issue is that it's trying to write to `buf[len++]` when len could
+potentially be 31, which would write to buf[31] in a buffer of size 32
+(valid indices 0-31), but the len++ post-increment means it could
+theoretically write beyond the buffer bounds.
+
+Fixes
+
+../../sources/safec-3.9.1/src/str/vsnprintf_s.c: In function 'safec_ftoa.isra':
+../../sources/safec-3.9.1/src/str/vsnprintf_s.c:523:24: error: writing 32 bytes into a region of size 31 [-Werror=stringop-overflow=]
+  523 |             buf[len++] = '0';
+      |             ~~~~~~~~~~~^~~~~
+../../sources/safec-3.9.1/src/str/vsnprintf_s.c:394:10: note: at offset [1, 32] into destination object 'buf' of size 32
+  394 |     char buf[PRINTF_FTOA_BUFFER_SIZE];
+      |          ^~~
+cc1: all warnings being treated as errors
+
+Upstream-Status: Submitted [https://github.com/rurban/safeclib/pull/148]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream: https://github.com/rurban/safeclib/commit/f59a0c8c1b5cf19cd0ed7f9bfb3a1e85f54113d0
+
+[backported to version 3.7.1]
+Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
+---
+ src/str/vsnprintf_s.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/str/vsnprintf_s.c b/src/str/vsnprintf_s.c
+index ca838df1..8ef6989a 100644
+--- a/src/str/vsnprintf_s.c
++++ b/src/str/vsnprintf_s.c
+@@ -369,7 +369,7 @@ static size_t safec_ftoa(out_fct_type out,  const char *funcname,
+                          double value, unsigned int prec, unsigned int width,
+                          unsigned int flags)
+ {
+-    char buf[PRINTF_FTOA_BUFFER_SIZE];
++    char buf[PRINTF_FTOA_BUFFER_SIZE + 1];
+     size_t len = 0U;
+     double tmp;
+     double diff = 0.0;
+-- 
+2.47.3
+
diff --git a/package/safeclib/0001-fix-armv7-asm-inline-error-GH-115.patch b/package/safeclib/0003-fix-armv7-asm-inline-error-GH-115.patch
similarity index 98%
rename from package/safeclib/0001-fix-armv7-asm-inline-error-GH-115.patch
rename to package/safeclib/0003-fix-armv7-asm-inline-error-GH-115.patch
index 3cb37b96f5..bf14812318 100644
--- a/package/safeclib/0001-fix-armv7-asm-inline-error-GH-115.patch
+++ b/package/safeclib/0003-fix-armv7-asm-inline-error-GH-115.patch
@@ -7,8 +7,8 @@ some armv7 buildroot variants fail on asm.
 we already probe for that, so use it.
 Fixes GH #115
 
-[Retrieved from:
-https://github.com/rurban/safeclib/commit/9c739800a8915d5f2a73c840190920e95ffa1c5c]
+Upstream: https://github.com/rurban/safeclib/commit/9c739800a8915d5f2a73c840190920e95ffa1c5c
+
 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
 ---
  tests/perf_private.h | 49 +++++++++++++++++++++++++-------------------
-- 
2.47.3

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 2/2] package/safeclib: bump version to 3.9.1
  2026-01-10 13:39 [Buildroot] [PATCH 1/2] package/safeclib: fix build with gcc-14.x Bernd Kuhls
@ 2026-01-10 13:39 ` Bernd Kuhls
  2026-02-03 14:09   ` Thomas Petazzoni via buildroot
  2026-02-03 14:09 ` [Buildroot] [PATCH 1/2] package/safeclib: fix build with gcc-14.x Thomas Petazzoni via buildroot
  2026-02-13 19:37 ` Thomas Perale via buildroot
  2 siblings, 1 reply; 5+ messages in thread
From: Bernd Kuhls @ 2026-01-10 13:39 UTC (permalink / raw)
  To: buildroot; +Cc: Fabrice Fontaine

https://github.com/rurban/safeclib/blob/v3.9.1/ChangeLog

Removed backports from patches 0001 & 0002.

Removed patch 0003 which is included in this release.

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
 ...snprintf_s-Increase-Buffer-Size-by-1.patch |   9 +-
 ...snprintf_s-Increase-Buffer-Size-by-1.patch |  15 +-
 ...03-fix-armv7-asm-inline-error-GH-115.patch | 156 ------------------
 package/safeclib/safeclib.hash                |   4 +-
 package/safeclib/safeclib.mk                  |   2 +-
 5 files changed, 14 insertions(+), 172 deletions(-)
 delete mode 100644 package/safeclib/0003-fix-armv7-asm-inline-error-GH-115.patch

diff --git a/package/safeclib/0001-vsnprintf_s-Increase-Buffer-Size-by-1.patch b/package/safeclib/0001-vsnprintf_s-Increase-Buffer-Size-by-1.patch
index eae11dcc0d..c744e043d9 100644
--- a/package/safeclib/0001-vsnprintf_s-Increase-Buffer-Size-by-1.patch
+++ b/package/safeclib/0001-vsnprintf_s-Increase-Buffer-Size-by-1.patch
@@ -27,20 +27,19 @@ cc1: all warnings being treated as errors
 
 Upstream: https://github.com/rurban/safeclib/pull/150
 
-[backported to version 3.7.1]
 Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
 ---
  src/str/vsnprintf_s.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/src/str/vsnprintf_s.c b/src/str/vsnprintf_s.c
-index 59dbda94..ca838df1 100644
+index 0b62c3cb..cf8e866e 100644
 --- a/src/str/vsnprintf_s.c
 +++ b/src/str/vsnprintf_s.c
-@@ -296,7 +296,7 @@ static size_t safec_ntoa_long(out_fct_type out,  const char *funcname,
+@@ -309,7 +309,7 @@ static size_t safec_ntoa_long(out_fct_type out, const char *funcname,
+                               unsigned long value, bool negative,
                                unsigned long base, unsigned int prec,
-                               unsigned int width, unsigned int flags)
- {
+                               unsigned int width, unsigned int flags) {
 -    char buf[PRINTF_NTOA_BUFFER_SIZE];
 +    char buf[PRINTF_NTOA_BUFFER_SIZE + 1];
      size_t len = 0U;
diff --git a/package/safeclib/0002-vsnprintf_s-Increase-Buffer-Size-by-1.patch b/package/safeclib/0002-vsnprintf_s-Increase-Buffer-Size-by-1.patch
index 2dabebf3b2..13d0cc71f5 100644
--- a/package/safeclib/0002-vsnprintf_s-Increase-Buffer-Size-by-1.patch
+++ b/package/safeclib/0002-vsnprintf_s-Increase-Buffer-Size-by-1.patch
@@ -25,23 +25,22 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
 
 Upstream: https://github.com/rurban/safeclib/commit/f59a0c8c1b5cf19cd0ed7f9bfb3a1e85f54113d0
 
-[backported to version 3.7.1]
 Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
 ---
  src/str/vsnprintf_s.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/src/str/vsnprintf_s.c b/src/str/vsnprintf_s.c
-index ca838df1..8ef6989a 100644
+index fa53ab42..0b62c3cb 100644
 --- a/src/str/vsnprintf_s.c
 +++ b/src/str/vsnprintf_s.c
-@@ -369,7 +369,7 @@ static size_t safec_ftoa(out_fct_type out,  const char *funcname,
-                          double value, unsigned int prec, unsigned int width,
-                          unsigned int flags)
- {
+@@ -391,7 +391,7 @@ static size_t safec_ftoa(out_fct_type out, const char *funcname, char *buffer,
+                          size_t idx, size_t maxlen, double value,
+                          unsigned int prec, unsigned int width,
+                          unsigned int flags) {
 -    char buf[PRINTF_FTOA_BUFFER_SIZE];
-+    char buf[PRINTF_FTOA_BUFFER_SIZE + 1];
-     size_t len = 0U;
++    char buf[PRINTF_FTOA_BUFFER_SIZE + 1]; // Add extra byte for safety
+     size_t len = 0U, off = 0U;
      double tmp;
      double diff = 0.0;
 -- 
diff --git a/package/safeclib/0003-fix-armv7-asm-inline-error-GH-115.patch b/package/safeclib/0003-fix-armv7-asm-inline-error-GH-115.patch
deleted file mode 100644
index bf14812318..0000000000
--- a/package/safeclib/0003-fix-armv7-asm-inline-error-GH-115.patch
+++ /dev/null
@@ -1,156 +0,0 @@
-From 9c739800a8915d5f2a73c840190920e95ffa1c5c Mon Sep 17 00:00:00 2001
-From: Reini Urban <rurban@cpan.org>
-Date: Fri, 18 Feb 2022 09:46:45 +0100
-Subject: [PATCH] fix armv7 asm inline error GH #115
-
-some armv7 buildroot variants fail on asm.
-we already probe for that, so use it.
-Fixes GH #115
-
-Upstream: https://github.com/rurban/safeclib/commit/9c739800a8915d5f2a73c840190920e95ffa1c5c
-
-Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
----
- tests/perf_private.h | 49 +++++++++++++++++++++++++-------------------
- 1 file changed, 28 insertions(+), 21 deletions(-)
-
-diff --git a/tests/perf_private.h b/tests/perf_private.h
-index 3296cb3d..843674d3 100644
---- a/tests/perf_private.h
-+++ b/tests/perf_private.h
-@@ -1,9 +1,9 @@
- /*------------------------------------------------------------------
-  * perf_private.h - Internal benchmarking tools
-  *
-- * 2020  Reini Urban
-+ * 2020,2022  Reini Urban
-  *
-- * Copyright (c) 2017, 2020 Reini Urban
-+ * Copyright (c) 2017, 2020, 2022 Reini Urban
-  * All rights reserved.
-  *
-  * Permission is hereby granted, free of charge, to any person
-@@ -55,13 +55,16 @@ static inline uint64_t timer_start();
- static inline uint64_t timer_end();
- 
- static inline clock_t rdtsc() {
--#ifdef __x86_64__
-+#ifndef ASM_INLINE
-+#define NO_CYCLE_COUNTER
-+    return clock();
-+#elif defined __x86_64__
-     uint64_t a, d;
--    __asm__ volatile("rdtsc" : "=a"(a), "=d"(d));
-+    ASM_INLINE volatile("rdtsc" : "=a"(a), "=d"(d));
-     return (clock_t)(a | (d << 32));
- #elif defined(__i386__)
-     clock_t x;
--    __asm__ volatile("rdtsc" : "=A"(x));
-+    ASM_INLINE volatile("rdtsc" : "=A"(x));
-     return x;
- #elif defined(__ARM_ARCH) && (__ARM_ARCH >= 7) && (SIZEOF_SIZE_T == 4)
-   // V7 is the earliest arch that has a standard cyclecount (some say 6)
-@@ -69,11 +72,11 @@ static inline clock_t rdtsc() {
-   uint32_t pmuseren;
-   uint32_t pmcntenset;
-   // Read the user mode perf monitor counter access permissions.
--  asm volatile("mrc p15, 0, %0, c9, c14, 0" : "=r"(pmuseren));
-+  ASM_INLINE volatile("mrc p15, 0, %0, c9, c14, 0" : "=r"(pmuseren));
-   if (pmuseren & 1) {  // Allows reading perfmon counters for user mode code.
--    asm volatile("mrc p15, 0, %0, c9, c12, 1" : "=r"(pmcntenset));
-+    ASM_INLINE volatile("mrc p15, 0, %0, c9, c12, 1" : "=r"(pmcntenset));
-     if (pmcntenset & 0x80000000ul) {  // Is it counting?
--      asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r"(pmccntr));
-+      ASM_INLINE volatile("mrc p15, 0, %0, c9, c13, 0" : "=r"(pmccntr));
-       // The counter is set up to count every 64th cycle
-       return (int64_t)(pmccntr) * 64;  // Should optimize to << 6
-     }
-@@ -83,22 +86,22 @@ static inline clock_t rdtsc() {
-   uint64_t pmccntr;
-   uint64_t pmuseren = 1UL;
-   // Read the user mode perf monitor counter access permissions.
--  //asm volatile("mrs cntv_ctl_el0,  %0" : "=r" (pmuseren));
-+  //ASM_INLINE volatile("mrs cntv_ctl_el0,  %0" : "=r" (pmuseren));
-   if (pmuseren & 1) {  // Allows reading perfmon counters for user mode code.
--    asm volatile("mrs %0, cntvct_el0" : "=r" (pmccntr));
-+    ASM_INLINE volatile("mrs %0, cntvct_el0" : "=r" (pmccntr));
-     return (uint64_t)(pmccntr) * 64;  // Should optimize to << 6
-   }
-   return (uint64_t)rdtsc();
- #elif defined(__powerpc64__) || defined(__ppc64__)
-     uint64_t tb;
--    __asm__ volatile (\
-+    ASM_INLINE volatile (\
-       "mfspr %0, 268"
-       : "=r" (tb));
-     return tb;
- #elif defined(__powerpc__) || defined(__ppc__)
-     // This returns a time-base, which is not always precisely a cycle-count.
-     uint32_t tbu, tbl, tmp;
--    __asm__ volatile (\
-+    ASM_INLINE volatile (\
-       "0:\n"
-       "mftbu %0\n"
-       "mftbl %1\n"
-@@ -109,12 +112,12 @@ static inline clock_t rdtsc() {
-     return (((uint64_t) tbu << 32) | tbl);
- #elif defined(__sparc__)
-     uint64_t tick;
--    asm(".byte 0x83, 0x41, 0x00, 0x00");
--    asm("mov   %%g1, %0" : "=r" (tick));
-+    ASM_INLINE(".byte 0x83, 0x41, 0x00, 0x00");
-+    ASM_INLINE("mov   %%g1, %0" : "=r" (tick));
-     return tick;
- #elif defined(__ia64__)
-     uint64_t itc;
--    asm("mov %0 = ar.itc" : "=r" (itc));
-+    ASM_INLINE("mov %0 = ar.itc" : "=r" (itc));
-     return itc;
- #else
- #define NO_CYCLE_COUNTER
-@@ -126,9 +129,11 @@ static inline clock_t rdtsc() {
- // 3.2.1 The Improved Benchmarking Method
- static inline uint64_t timer_start()
- {
--#if defined (__i386__) || (defined(__x86_64__) && SIZEOF_SIZE_T == 4)
-+#ifndef ASM_INLINE
-+    return (uint64_t)rdtsc();
-+#elif defined (__i386__) || (defined(__x86_64__) && SIZEOF_SIZE_T == 4)
-   uint32_t cycles_high, cycles_low;
--  __asm__ volatile
-+  ASM_INLINE volatile
-       ("cpuid\n\t"
-        "rdtsc\n\t"
-        "mov %%edx, %0\n\t"
-@@ -137,7 +142,7 @@ static inline uint64_t timer_start()
-     return ((uint64_t)cycles_high << 32) | cycles_low;
- #elif defined __x86_64__
-   uint32_t cycles_high, cycles_low;
--  __asm__ volatile
-+  ASM_INLINE volatile
-       ("cpuid\n\t"
-        "rdtsc\n\t"
-        "mov %%edx, %0\n\t"
-@@ -151,9 +156,11 @@ static inline uint64_t timer_start()
- 
- static inline uint64_t timer_end()
- {
--#if defined (__i386__) || (defined(__x86_64__) && defined (HAVE_BIT32))
-+#ifndef ASM_INLINE
-+    return (uint64_t)rdtsc();
-+#elif defined (__i386__) || (defined(__x86_64__) && defined (HAVE_BIT32))
-   uint32_t cycles_high, cycles_low;
--  __asm__ volatile
-+ ASM_INLINE volatile
-       ("rdtscp\n\t"
-        "mov %%edx, %0\n\t"
-        "mov %%eax, %1\n\t"
-@@ -162,7 +169,7 @@ static inline uint64_t timer_end()
-     return ((uint64_t)cycles_high << 32) | cycles_low;
- #elif defined __x86_64__
-   uint32_t cycles_high, cycles_low;
--  __asm__ volatile
-+  ASM_INLINE volatile
-       ("rdtscp\n\t"
-        "mov %%edx, %0\n\t"
-        "mov %%eax, %1\n\t"
diff --git a/package/safeclib/safeclib.hash b/package/safeclib/safeclib.hash
index bca5d86261..0227ff2837 100644
--- a/package/safeclib/safeclib.hash
+++ b/package/safeclib/safeclib.hash
@@ -1,5 +1,5 @@
-# From https://github.com/rurban/safeclib/releases/tag/v3.7.1
-sha256  71d3ec970f930bd980f2a41127228eeedfc53749e4c6b203329adc4ff7df32a7  safeclib-3.7.1.tar.xz
+# From https://github.com/rurban/safeclib/releases/tag/v3.9.1
+sha256  771b8de483c4f48c90c12bc2c0326571d3d094440ca29008e4cf70562c631c67  safeclib-3.9.1.tar.xz
 
 # Hash for license file
 sha256  c33e77efd5781e3d59a2bb648c82d2a615035ef0d24cf58880380e3af906510b  COPYING
diff --git a/package/safeclib/safeclib.mk b/package/safeclib/safeclib.mk
index bc58c1a38c..6478796a7e 100644
--- a/package/safeclib/safeclib.mk
+++ b/package/safeclib/safeclib.mk
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-SAFECLIB_VERSION = 3.7.1
+SAFECLIB_VERSION = 3.9.1
 SAFECLIB_SITE = \
 	https://github.com/rurban/safeclib/releases/download/v$(SAFECLIB_VERSION)
 SAFECLIB_SOURCE = safeclib-$(SAFECLIB_VERSION).tar.xz
-- 
2.47.3

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Buildroot] [PATCH 1/2] package/safeclib: fix build with gcc-14.x
  2026-01-10 13:39 [Buildroot] [PATCH 1/2] package/safeclib: fix build with gcc-14.x Bernd Kuhls
  2026-01-10 13:39 ` [Buildroot] [PATCH 2/2] package/safeclib: bump version to 3.9.1 Bernd Kuhls
@ 2026-02-03 14:09 ` Thomas Petazzoni via buildroot
  2026-02-13 19:37 ` Thomas Perale via buildroot
  2 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-02-03 14:09 UTC (permalink / raw)
  To: Bernd Kuhls; +Cc: buildroot, Fabrice Fontaine

On Sat, Jan 10, 2026 at 02:39:04PM +0100, Bernd Kuhls wrote:
> Backported two upstream patches to fix build errors introduced by the
> bump of gcc to 14.x.
> 
> Renamed patch 0001 to prepare its removal with the upcoming version bump
> of safelib, added Upstream: tag.

Adding the Upstream: tag in 0001 should have been a separate patch, so
I split that up. Also the renaming didn't make a lot of sense, so I
kept the same file name.

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Buildroot] [PATCH 2/2] package/safeclib: bump version to 3.9.1
  2026-01-10 13:39 ` [Buildroot] [PATCH 2/2] package/safeclib: bump version to 3.9.1 Bernd Kuhls
@ 2026-02-03 14:09   ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-02-03 14:09 UTC (permalink / raw)
  To: Bernd Kuhls; +Cc: buildroot, Fabrice Fontaine

On Sat, Jan 10, 2026 at 02:39:05PM +0100, Bernd Kuhls wrote:
> https://github.com/rurban/safeclib/blob/v3.9.1/ChangeLog
> 
> Removed backports from patches 0001 & 0002.
> 
> Removed patch 0003 which is included in this release.
> 
> Signed-off-by: Bernd Kuhls <bernd@kuhls.net>

Applied, thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Buildroot] [PATCH 1/2] package/safeclib: fix build with gcc-14.x
  2026-01-10 13:39 [Buildroot] [PATCH 1/2] package/safeclib: fix build with gcc-14.x Bernd Kuhls
  2026-01-10 13:39 ` [Buildroot] [PATCH 2/2] package/safeclib: bump version to 3.9.1 Bernd Kuhls
  2026-02-03 14:09 ` [Buildroot] [PATCH 1/2] package/safeclib: fix build with gcc-14.x Thomas Petazzoni via buildroot
@ 2026-02-13 19:37 ` Thomas Perale via buildroot
  2 siblings, 0 replies; 5+ messages in thread
From: Thomas Perale via buildroot @ 2026-02-13 19:37 UTC (permalink / raw)
  To: Bernd Kuhls; +Cc: Thomas Perale, buildroot

In reply of:
> Backported two upstream patches to fix build errors introduced by the
> bump of gcc to 14.x.
> 
> Renamed patch 0001 to prepare its removal with the upcoming version bump
> of safelib, added Upstream: tag.
> 
> Fixes:
> https://autobuild.buildroot.net/results/af6/af65e6386439098ddf706ca43e99320cf5e9fd80/
> 
> Signed-off-by: Bernd Kuhls <bernd@kuhls.net>

Applied to 2025.02.x & 2025.11.x. Thanks

> ---
>  .checkpackageignore                           |  1 -
>  ...snprintf_s-Increase-Buffer-Size-by-1.patch | 51 +++++++++++++++++++
>  ...snprintf_s-Increase-Buffer-Size-by-1.patch | 49 ++++++++++++++++++
>  ...3-fix-armv7-asm-inline-error-GH-115.patch} |  4 +-
>  4 files changed, 102 insertions(+), 3 deletions(-)
>  create mode 100644 package/safeclib/0001-vsnprintf_s-Increase-Buffer-Size-by-1.patch
>  create mode 100644 package/safeclib/0002-vsnprintf_s-Increase-Buffer-Size-by-1.patch
>  rename package/safeclib/{0001-fix-armv7-asm-inline-error-GH-115.patch => 0003-fix-armv7-asm-inline-error-GH-115.patch} (98%)
> 
> diff --git a/.checkpackageignore b/.checkpackageignore
> index ad02938884..2502803da3 100644
> --- a/.checkpackageignore
> +++ b/.checkpackageignore
> @@ -873,7 +873,6 @@ package/rubix/0001-dont-use-legacy-functions.patch lib_patch.Upstream
>  package/rubix/0002-misc-fixes.patch lib_patch.Sob lib_patch.Upstream
>  package/rygel/S99rygel Shellcheck lib_sysv.Indent lib_sysv.Variables
>  package/s6-linux-init/0001-configure-add-D_GNU_SOURCE.patch lib_patch.Upstream
> -package/safeclib/0001-fix-armv7-asm-inline-error-GH-115.patch lib_patch.Upstream
>  package/samba4/0001-build-find-pre-built-heimdal-build-tools-in-case-of-.patch lib_patch.Upstream
>  package/samba4/0002-ldap_message_test.c-include-stdint.h-before-cmoka.h.patch lib_patch.Upstream
>  package/samba4/S91smb Shellcheck lib_sysv.Indent lib_sysv.Variables
> diff --git a/package/safeclib/0001-vsnprintf_s-Increase-Buffer-Size-by-1.patch b/package/safeclib/0001-vsnprintf_s-Increase-Buffer-Size-by-1.patch
> new file mode 100644
> index 0000000000..eae11dcc0d
> --- /dev/null
> +++ b/package/safeclib/0001-vsnprintf_s-Increase-Buffer-Size-by-1.patch
> @@ -0,0 +1,51 @@
> +From 62051f9761f92dc99c8ce0552239ad10e2062168 Mon Sep 17 00:00:00 2001
> +From: Bernd Kuhls <bernd@kuhls.net>
> +Date: Sat, 10 Jan 2026 12:16:22 +0100
> +Subject: [PATCH] vsnprintf_s: Increase Buffer Size by 1
> +
> +Another fix similar to https://github.com/rurban/safeclib/commit/f59a0c8c1b5cf19cd0ed7f9bfb3a1e85f54113d0
> +
> +In function 'safec_ntoa_format',
> +    inlined from 'safec_ntoa_long' at str/vsnprintf_s.c:331:12:
> +str/vsnprintf_s.c:256:24: error: writing 32 bytes into a region of size 0 [-Werror=stringop-overflow=]
> +  256 |             buf[len++] = '0';
> +      |             ~~~~~~~~~~~^~~~~
> +str/vsnprintf_s.c: In function 'safec_ntoa_long':
> +str/vsnprintf_s.c:312:10: note: at offset 32 into destination object 'buf' of size 32
> +  312 |     char buf[PRINTF_NTOA_BUFFER_SIZE];
> +      |          ^~~
> +In function 'safec_ntoa_format',
> +    inlined from 'safec_ntoa_long' at str/vsnprintf_s.c:331:12:
> +str/vsnprintf_s.c:260:24: error: writing 32 bytes into a region of size 0 [-Werror=stringop-overflow=]
> +  260 |             buf[len++] = '0';
> +      |             ~~~~~~~~~~~^~~~~
> +str/vsnprintf_s.c: In function 'safec_ntoa_long':
> +str/vsnprintf_s.c:312:10: note: at offset 32 into destination object 'buf' of size 32
> +  312 |     char buf[PRINTF_NTOA_BUFFER_SIZE];
> +      |          ^~~
> +cc1: all warnings being treated as errors
> +
> +Upstream: https://github.com/rurban/safeclib/pull/150
> +
> +[backported to version 3.7.1]
> +Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
> +---
> + src/str/vsnprintf_s.c | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/src/str/vsnprintf_s.c b/src/str/vsnprintf_s.c
> +index 59dbda94..ca838df1 100644
> +--- a/src/str/vsnprintf_s.c
> ++++ b/src/str/vsnprintf_s.c
> +@@ -296,7 +296,7 @@ static size_t safec_ntoa_long(out_fct_type out,  const char *funcname,
> +                               unsigned long base, unsigned int prec,
> +                               unsigned int width, unsigned int flags)
> + {
> +-    char buf[PRINTF_NTOA_BUFFER_SIZE];
> ++    char buf[PRINTF_NTOA_BUFFER_SIZE + 1];
> +     size_t len = 0U;
> + 
> +     // no hash for 0 values
> +-- 
> +2.47.3
> +
> diff --git a/package/safeclib/0002-vsnprintf_s-Increase-Buffer-Size-by-1.patch b/package/safeclib/0002-vsnprintf_s-Increase-Buffer-Size-by-1.patch
> new file mode 100644
> index 0000000000..2dabebf3b2
> --- /dev/null
> +++ b/package/safeclib/0002-vsnprintf_s-Increase-Buffer-Size-by-1.patch
> @@ -0,0 +1,49 @@
> +From dea3c2e1aa1b775baa690b9ef40239f881c5f068 Mon Sep 17 00:00:00 2001
> +From: Khem Raj <raj.khem@gmail.com>
> +Date: Wed, 13 Aug 2025 20:23:48 -0700
> +Subject: [PATCH] vsnprintf_s: Increase Buffer Size by 1
> +
> +It is a buffer overflow warning that GCC 15.2 is catching.
> +The issue is that it's trying to write to `buf[len++]` when len could
> +potentially be 31, which would write to buf[31] in a buffer of size 32
> +(valid indices 0-31), but the len++ post-increment means it could
> +theoretically write beyond the buffer bounds.
> +
> +Fixes
> +
> +../../sources/safec-3.9.1/src/str/vsnprintf_s.c: In function 'safec_ftoa.isra':
> +../../sources/safec-3.9.1/src/str/vsnprintf_s.c:523:24: error: writing 32 bytes into a region of size 31 [-Werror=stringop-overflow=]
> +  523 |             buf[len++] = '0';
> +      |             ~~~~~~~~~~~^~~~~
> +../../sources/safec-3.9.1/src/str/vsnprintf_s.c:394:10: note: at offset [1, 32] into destination object 'buf' of size 32
> +  394 |     char buf[PRINTF_FTOA_BUFFER_SIZE];
> +      |          ^~~
> +cc1: all warnings being treated as errors
> +
> +Upstream-Status: Submitted [https://github.com/rurban/safeclib/pull/148]
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +
> +Upstream: https://github.com/rurban/safeclib/commit/f59a0c8c1b5cf19cd0ed7f9bfb3a1e85f54113d0
> +
> +[backported to version 3.7.1]
> +Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
> +---
> + src/str/vsnprintf_s.c | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/src/str/vsnprintf_s.c b/src/str/vsnprintf_s.c
> +index ca838df1..8ef6989a 100644
> +--- a/src/str/vsnprintf_s.c
> ++++ b/src/str/vsnprintf_s.c
> +@@ -369,7 +369,7 @@ static size_t safec_ftoa(out_fct_type out,  const char *funcname,
> +                          double value, unsigned int prec, unsigned int width,
> +                          unsigned int flags)
> + {
> +-    char buf[PRINTF_FTOA_BUFFER_SIZE];
> ++    char buf[PRINTF_FTOA_BUFFER_SIZE + 1];
> +     size_t len = 0U;
> +     double tmp;
> +     double diff = 0.0;
> +-- 
> +2.47.3
> +
> diff --git a/package/safeclib/0001-fix-armv7-asm-inline-error-GH-115.patch b/package/safeclib/0003-fix-armv7-asm-inline-error-GH-115.patch
> similarity index 98%
> rename from package/safeclib/0001-fix-armv7-asm-inline-error-GH-115.patch
> rename to package/safeclib/0003-fix-armv7-asm-inline-error-GH-115.patch
> index 3cb37b96f5..bf14812318 100644
> --- a/package/safeclib/0001-fix-armv7-asm-inline-error-GH-115.patch
> +++ b/package/safeclib/0003-fix-armv7-asm-inline-error-GH-115.patch
> @@ -7,8 +7,8 @@ some armv7 buildroot variants fail on asm.
>  we already probe for that, so use it.
>  Fixes GH #115
>  
> -[Retrieved from:
> -https://github.com/rurban/safeclib/commit/9c739800a8915d5f2a73c840190920e95ffa1c5c]
> +Upstream: https://github.com/rurban/safeclib/commit/9c739800a8915d5f2a73c840190920e95ffa1c5c
> +
>  Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
>  ---
>   tests/perf_private.h | 49 +++++++++++++++++++++++++-------------------
> -- 
> 2.47.3
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-02-13 19:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-10 13:39 [Buildroot] [PATCH 1/2] package/safeclib: fix build with gcc-14.x Bernd Kuhls
2026-01-10 13:39 ` [Buildroot] [PATCH 2/2] package/safeclib: bump version to 3.9.1 Bernd Kuhls
2026-02-03 14:09   ` Thomas Petazzoni via buildroot
2026-02-03 14:09 ` [Buildroot] [PATCH 1/2] package/safeclib: fix build with gcc-14.x Thomas Petazzoni via buildroot
2026-02-13 19:37 ` Thomas Perale via buildroot

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