Hi,

I have just pushed a change to transliterate ASCII DEL control characters
similarly to most other ASCII control characters, i.e., as '^?'.  Please
see the attached patch for the changes.

FreeBSD and OpenBSD do the same.  NetBSD uses a different representation,
but includes DEL in the transliteration as well.  At least as I read
the code, it is quite different between the three BSDs and GNU Inetutils.

Cheers,
Erik
commit db5823e95c36f44aff3e0630c95dd83a2f87afde
Author: Erik Auerswald <[email protected]>
Date:   2025-11-23 19:00:12 +0100

    syslogd: log ASCII 'DEL' as '^?'
    
    DEL is a non-printable control character.  Make it visible in
    syslogd log files by transliterating it in the same way as most
    other ASCII control characters (TAB and NL are transliterated
    as SP).
    
    * NEWS: Mention change.
    * src/syslogd.c (printline): Transliterate the ASCII DEL control
      character the same way as most other ASCII control characters.

diff --git a/NEWS b/NEWS
index 6d65b0e8..25664893 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,8 @@ Thanks to Benjamin Cathelineau, see
 
 ** syslogd: Fix a stack-based buffer overflow (CWE-121).
 
+** syslogd: Log 'DEL' control characters as '^?'.
+
 * Noteworthy changes in release 2.6 (2025-02-21) [stable]
 
 ** The release tarball is now reproducible.
diff --git a/src/syslogd.c b/src/syslogd.c
index 17def8d2..ea4e21f9 100644
--- a/src/syslogd.c
+++ b/src/syslogd.c
@@ -1099,7 +1099,7 @@ printline (const char *hname, const char *msg)
 	*q++ = ' ';
       else if (c == '\t')
 	*q++ = '\t';
-      else if (c >= 0177)
+      else if (c > 0177)
 	*q++ = c;
       else
 	{

Reply via email to