commit-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Inetutils branch, master, updated. inetutils-1_8-107-g7ccaddf


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_8-107-g7ccaddf
Date: Wed, 13 Jul 2011 12:46:49 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  7ccaddf1f5f049343b7a85169550374d748916fc (commit)
      from  77ca51191bd57e953a1c289290e9f5d94238ba55 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=7ccaddf1f5f049343b7a85169550374d748916fc


commit 7ccaddf1f5f049343b7a85169550374d748916fc
Author: Mats Erik Andersson <address@hidden>
Date:   Wed Jul 13 14:40:06 2011 +0200

    syslogd: Error recovery at config parsing.
    
    An empty action field makes OpenBSD go segfaulting.
    Signal such an entry as unused, instead of passing
    a NULL string as user name!

diff --git a/ChangeLog b/ChangeLog
index d0ae04c..69c305b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-07-13  Mats Erik Andersson <address@hidden>
+
+       * src/syslogd.c (cfline): Prevent incrementing beyond string end.
+       Discard config line with empty action.
+       * tests/syslogd.sh: Three new degenerate config lines.
+
 2011-06-20  Mats Erik Andersson <address@hidden>
 
        * src/syslogd.c: Replace all `struct sockaddr_in' with
diff --git a/src/syslogd.c b/src/syslogd.c
index a56414e..4d73f69 100644
--- a/src/syslogd.c
+++ b/src/syslogd.c
@@ -1860,7 +1860,7 @@ cfline (const char *line, struct filed *f)
       *bp = '\0';
 
       /* Skip cruft.  */
-      while (strchr (",;", *q))
+      while (*q && strchr (",;", *q))
        q++;
 
       bp = buf;
@@ -1962,6 +1962,14 @@ cfline (const char *line, struct filed *f)
       p++;
     }
 
+  if (!strlen(p))
+    {
+      /* Invalidate an entry with empty action field.  */
+      f->f_type = F_UNUSED;
+      logerror ("empty action field");
+      return;
+    }
+
   switch (*p)
     {
     case '@':
diff --git a/tests/syslogd.sh b/tests/syslogd.sh
index 124469d..05848b7 100755
--- a/tests/syslogd.sh
+++ b/tests/syslogd.sh
@@ -69,7 +69,12 @@ fi
 #
 cat > $CONF <<-EOT
        *.*     $OUT
+       # Test incorrect forwarding.
        *.*     @not.in.existence
+       # Recover from missing action field and short selector.
+       12345
+       *.*
+       *.      /dev/null
 EOT
 
 # Set REMOTE_LOGHOST to activate forwarding
@@ -77,6 +82,7 @@ EOT
 if [ -n "$REMOTE_LOGHOST" ]; then
        # Append a forwarding stanza.
        cat >> $CONF <<-EOT
+               # Forwarding remotely
                *.*     @$REMOTE_LOGHOST
        EOT
 fi

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog        |    6 ++++++
 src/syslogd.c    |   10 +++++++++-
 tests/syslogd.sh |    6 ++++++
 3 files changed, 21 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]