X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=loaders.c;h=85c8d29694a3be611b976eadb038fb92d133f5ac;hb=f084962e4e49716de38677c95db9402a1e9a309c;hp=ee767186f276b8d1180eaef305680db3542b3cb6;hpb=e72b401da5537a14b29e945944926373cb251825;p=privoxy.git diff --git a/loaders.c b/loaders.c index ee767186..85c8d296 100644 --- 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; } }