From: Frank M. Kromann Date: Fri, 6 Dec 2002 22:52:31 +0000 (+0000) Subject: Fixing a possible strcat on a NULL pointer X-Git-Tag: RELEASE_1_0b3~136 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0d812352be41478085bdc18cd5fb9dc5fcfd5297;p=php Fixing a possible strcat on a NULL pointer --- diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index de4bb1e162..4bfcafdad5 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -3222,7 +3222,8 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char * } } - strcat(bufferHeader, headers); + if (headers && *headers) + strcat(bufferHeader, headers); if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg, bufferHeader, subject, bufferTo, message, bufferCc, bufferBcc, rpath) != SUCCESS) { if (tsm_errmsg) {