]> granicus.if.org Git - php/commitdiff
use strlcat() and a bigger buffer
authorAntony Dovgal <tony2001@php.net>
Thu, 28 Dec 2006 12:01:14 +0000 (12:01 +0000)
committerAntony Dovgal <tony2001@php.net>
Thu, 28 Dec 2006 12:01:14 +0000 (12:01 +0000)
main/main.c

index 95b6424f0f21adfc6e153750d83f4d1942bd6112..4d6edc8d7102088b475a2a7e9d7684a815b68e50 100644 (file)
@@ -1070,7 +1070,7 @@ static void php_message_handler_for_zend(long message, void *data)
                case ZMSG_MEMORY_LEAK_REPEATED:
 #if ZEND_DEBUG
                        if (EG(error_reporting) & E_WARNING) {
-                               char memory_leak_buf[512];
+                               char memory_leak_buf[1024];
 
                                if (message==ZMSG_MEMORY_LEAK_DETECTED) {
                                        zend_leak_info *t = (zend_leak_info *) data;
@@ -1080,7 +1080,7 @@ static void php_message_handler_for_zend(long message, void *data)
                                                char relay_buf[512];
 
                                                snprintf(relay_buf, 512, "%s(%d) : Actual location (location was relayed)\n", t->orig_filename, t->orig_lineno);
-                                               strcat(memory_leak_buf, relay_buf);
+                                               strlcat(memory_leak_buf, relay_buf, sizeof(memory_leak_buf));
                                        }
                                } else {
                                        unsigned long leak_count = (unsigned long) data;