marc 97/02/15 23:44:16
Modified: src http_bprintf.c CHANGES
Log:
Stop vbprintf from core dumping if given a NULL string pointer.
Submitted by: Ken Coar <[EMAIL PROTECTED]>
Reviewed by: Marc Slemko, Dean Gaudet, Jim Jagielski
Revision Changes Path
1.8 +10 -0 apache/src/http_bprintf.c
Index: http_bprintf.c
===================================================================
RCS file: /export/home/cvs/apache/src/http_bprintf.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C3 -r1.7 -r1.8
*** http_bprintf.c 1996/11/03 20:36:34 1.7
--- http_bprintf.c 1997/02/16 07:44:14 1.8
***************
*** 42,47 ****
--- 42,51 ----
/*
* Max size of a format specifier is 1 + 5 + 7 + 7 + 2 + 1 + slop
*/
+ #define NULL_STRING "(null)"
+ /*
+ * String displayed if given a NULL pointer.
+ */
/*
* Copy n characters from *srcPtr to *destPtr, then increment
***************
*** 277,282 ****
--- 281,289 ----
case 's':
charPtrArg = va_arg(arg, char *);
+ if (charPtrArg == NULL) {
+ charPtrArg = NULL_STRING;
+ };
if(precision == -1)
buffReqd = strlen(charPtrArg);
else
***************
*** 444,449 ****
--- 451,459 ----
if(fastPath)
{
buffPtr = va_arg(arg, char *);
+ if (buffPtr == NULL) {
+ buffPtr = NULL_STRING;
+ };
buffCount = strlen(buffPtr);
buffLen = buffCount + 1;
}
1.161 +3 -0 apache/src/CHANGES
Index: CHANGES
===================================================================
RCS file: /export/home/cvs/apache/src/CHANGES,v
retrieving revision 1.160
retrieving revision 1.161
diff -C3 -r1.160 -r1.161
*** CHANGES 1997/02/15 12:26:19 1.160
--- CHANGES 1997/02/16 07:44:15 1.161
***************
*** 1,5 ****
--- 1,8 ----
Changes with Apache 1.2b7
+ *) Stop vbprintf from crashing if given a NULL string pointer;
+ print (null) instead. [Ken Coar]
+
*) Don't disable Nagle algorithm if system doesn't have TCP_NODELAY.
[Marc Slemko and Roy Fielding]