Package: electric-fence
Version: 2.2.7
Severity: normal

Dear Maintainer,

This is a follow up to #1074933. The fix for the ftbfs was to add a cast

diff -Naurp electric-fence_2.2.6/page.c electric-fence_2.2.7/page.c
--- electric-fence_2.2.6/page.c 2021-11-13 07:58:14.000000000 +1300
+++ electric-fence_2.2.7/page.c 2024-08-21 03:52:57.000000000 +1200
@@ -43,7 +43,7 @@ stringErrorReport(void)
 #elif ( defined(_AIX) )
        return strerror(errno);
 #else
-       return strerror_r(errno,(char *)err_message,128);
+       return (const char *) strerror_r(errno,(char *)err_message,128);
 #endif
 }

But according to strerror(3) there are two possible implementations of 
strerror_r().

       int strerror_r(int errnum, char *buf, size_t buflen);
                   /* XSI-compliant */

       char *strerror_r(int errnum, char *buf, size_t buflen);
                   /* GNU-specific */

       strerror_r():
           The XSI-compliant version is provided if:
           (_POSIX_C_SOURCE >= 200112L) && ! _GNU_SOURCE
           Otherwise, the GNU-specific version is provided.

GCC-14 now has _POSIX_C_SOURCE set to something higher than 200112L so we
appear to be getting the XSI compliant version of strerror_r() so simply adding
a cast is insufficient (and may lead to a null deference by the caller of
stringErrorReport()). This probably needs to be written as

static char err_message[128];
strerror_r(errno, err_message,128);
return err_message;

Or something should define _GNU_SOURCE to get the old behaviour. 

-- System Information:
Debian Release: bookworm/sid
  APT prefers jammy-updates
  APT policy: (500, 'jammy-updates'), (500, 'jammy-security'), (500, 'jammy'), 
(100, 'jammy-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.8.0-65-generic (SMP w/16 CPU threads; PREEMPT)
Kernel taint flags: TAINT_WARN
Locale: LANG=en_NZ.UTF-8, LC_CTYPE=en_NZ.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_NZ:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages electric-fence depends on:
ii  libc6  2.35-0ubuntu3.10

electric-fence recommends no packages.

electric-fence suggests no packages.

Reply via email to