INN commit: trunk/nnrpd (post.c)

INN Commit rra at isc.org
Mon Jan 4 19:50:28 UTC 2010


    Date: Monday, January 4, 2010 @ 11:50:27
  Author: iulius
Revision: 8880

Fix a segfault when virtualhosting is used in readers.conf.
The new Path: header was generated with an invalid pointer.

Modified:
  trunk/nnrpd/post.c

--------+
 post.c |   22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

Modified: post.c
===================================================================
--- post.c	2010-01-04 19:49:14 UTC (rev 8879)
+++ post.c	2010-01-04 19:50:27 UTC (rev 8880)
@@ -433,19 +433,23 @@
     if (newpath != NULL)
         free(newpath);
     if (PERMaccessconf->addinjectionpostinghost) {
-        newpath = concat(".POSTED.", Client.host, "!", HDR(HDR__PATH), (char *) 0);
+        if (addvirtual) {
+            newpath = concat(VirtualPath, ".POSTED.", Client.host, "!",
+                             HDR(HDR__PATH), (char *) 0);
+        } else {
+            newpath = concat(".POSTED.", Client.host, "!", HDR(HDR__PATH),
+                             (char *) 0);
+        }
     } else {
-        newpath = concat(".POSTED!", HDR(HDR__PATH), (char *) 0);
+        if (addvirtual) {
+            newpath = concat(VirtualPath, ".POSTED!", HDR(HDR__PATH),
+                             (char *) 0);
+        } else {
+            newpath = concat(".POSTED!", HDR(HDR__PATH), (char *) 0);
+        }
     }
     HDR_SET(HDR__PATH, newpath);
 
-    if (addvirtual) {
-        if (newpath != NULL)
-            free(newpath);
-        newpath = concat(VirtualPath, HDR(HDR__PATH), (char *) 0);
-	HDR_SET(HDR__PATH, newpath);
-    }
-
     /* Reply-To: is left alone. */
     /* Sender: is set above. */
 




More information about the inn-committers mailing list