]> granicus.if.org Git - php/commitdiff
Fixed bug #70755: fpm_log.c memory leak and buffer overflow
authorStanislav Malyshev <stas@php.net>
Tue, 8 Dec 2015 08:10:07 +0000 (00:10 -0800)
committerAnatol Belski <ab@php.net>
Mon, 4 Jan 2016 16:36:42 +0000 (17:36 +0100)
sapi/fpm/fpm/fpm_log.c

index 86332c4c803bc33c328f084446446df84ebee048..5aad9a08c9e1738fe118226438f7c28eff031b0e 100644 (file)
@@ -448,6 +448,11 @@ int fpm_log_write(char *log_format) /* {{{ */
                                b += len2;
                                len += len2;
                        }
+                       if (len >= FPM_LOG_BUFFER) {
+                               zlog(ZLOG_NOTICE, "the log buffer is full (%d). The access log request has been truncated.", FPM_LOG_BUFFER);
+                               len = FPM_LOG_BUFFER;
+                               break;
+                       }
                        continue;
                }