Re: cvs: php4 /ext/imap php_imap.c

From: Date: Sat, 07 Dec 2002 08:04:16 +0000
Subject: Re: cvs: php4 /ext/imap php_imap.c
References: 1  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-16991@lists.php.net to get a copy of this message
Hey, Unless you are sure there can't be a buffer overrun in this strcat() call please use strlcat(). In any case, I think using strlcat() should be prefered. Andi At 10:52 PM 12/6/2002 +0000, Frank M. Kromann wrote:
fmk             Fri Dec  6 17:52:31 2002 EDT
Modified files:
    /php4/ext/imap      php_imap.c
Log: Fixing a possible strcat on a NULL pointer Index: php4/ext/imap/php_imap.c diff -u php4/ext/imap/php_imap.c:1.146 php4/ext/imap/php_imap.c:1.147
--- php4/ext/imap/php_imap.c:1.146      Sat Nov 30 16:49:20 2002
+++ php4/ext/imap/php_imap.c    Fri Dec  6 17:52:31 2002
@@ -26,7 +26,7 @@
    | PHP 4.0 updates:  Zeev Suraski <zeev@zend.com>                       |
    +----------------------------------------------------------------------+
*/ -/* $Id: php_imap.c,v 1.146 2002/11/30 21:49:20 fmk Exp $ */ +/* $Id: php_imap.c,v 1.147 2002/12/06 22:52:31 fmk Exp $ */ #define IMAP41 @@ -3222,7 +3222,8 @@
                }
        }
-       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) {
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.cvs (#16991) next »