From: oes Date: Wed, 25 Sep 2002 12:47:42 +0000 (+0000) Subject: Make log_error safe against NULL string arguments X-Git-Tag: v_3_0_1~137 X-Git-Url: http://www.privoxy.org/gitweb/@user-manual@?a=commitdiff_plain;h=8823b6b01eca8f9382bfd113b6242c9f1d8ed33a;p=privoxy.git Make log_error safe against NULL string arguments --- diff --git a/errlog.c b/errlog.c index 4a3cfe7e..c0dc8911 100644 --- a/errlog.c +++ b/errlog.c @@ -1,7 +1,7 @@ -const char errlog_rcs[] = "$Id: errlog.c,v 1.39 2002/04/03 17:15:27 gliptak Exp $"; +const char errlog_rcs[] = "$Id: errlog.c,v 1.40 2002/05/22 01:27:27 david__schmidt Exp $"; /********************************************************************* * - * File : $Source: /cvsroot/ijbswa/current/errlog.c,v $ + * File : $Source: /cvsroot/ijbswa//current/Attic/errlog.c,v $ * * Purpose : Log errors to a designated destination in an elegant, * printf-like fashion. @@ -33,6 +33,10 @@ const char errlog_rcs[] = "$Id: errlog.c,v 1.39 2002/04/03 17:15:27 gliptak Exp * * Revisions : * $Log: errlog.c,v $ + * Revision 1.40 2002/05/22 01:27:27 david__schmidt + * + * Add os2_socket_strerr mirroring w32_socket_strerr. + * * Revision 1.39 2002/04/03 17:15:27 gliptak * zero padding thread ids in log * @@ -609,6 +613,10 @@ void log_error(int loglevel, char *fmt, ...) break; case 's': sval = va_arg( ap, char * ); + if (sval == NULL) + { + sval = "[null]"; + } oldoutc = outc; outc += strlen(sval); if (outc < BUFFER_SIZE-1) @@ -626,6 +634,10 @@ void log_error(int loglevel, char *fmt, ...) */ ival = va_arg( ap, int ); sval = va_arg( ap, char * ); + if (sval == NULL) + { + sval = "[null]"; + } if (ival < 0) { ival = 0;