Actionsfile feedback item #2974204 2010-03-21
[privoxy.git] / loaders.c
index ee76718..85c8d29 100644 (file)
--- a/loaders.c
+++ b/loaders.c
@@ -1,4 +1,4 @@
-const char loaders_rcs[] = "$Id: loaders.c,v 1.72 2009/04/24 15:29:43 fabiankeil Exp $";
+const char loaders_rcs[] = "$Id: loaders.c,v 1.73 2009/05/16 13:27:20 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/loaders.c,v $
@@ -760,10 +760,14 @@ char *read_config_line(char *buf, size_t buflen, FILE *fp, unsigned long *linenu
    else
    {
       assert(buf2);
-      assert(strlen(buf2) + 1U < buflen);
-      strncpy(buf, buf2, buflen - 1);
+      if (strlen(buf2) + 1U > buflen)
+      {
+         log_error(LOG_LEVEL_FATAL,
+            "Max line limit reached. Linenumber: %u. Lenght: %u. Max lenght: %u.",
+            *linenum, strlen(buf2), buflen-1);
+      }
+      strlcpy(buf, buf2, buflen);
       free(buf2);
-      buf[buflen - 1] = '\0';
       return buf;
    }
 }