]> granicus.if.org Git - php/commitdiff
Fix off-by-one allocation
authorNikita Popov <nikita.ppv@gmail.com>
Fri, 20 Jul 2018 15:52:56 +0000 (17:52 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Fri, 20 Jul 2018 15:52:56 +0000 (17:52 +0200)
The return value of this function is pretty meaningless, but
leaving it alone for now.

sapi/fpm/fpm/zlog.c

index d158c06fd210b2663316cea70727b00d8ebf35f7..cd5260ba67a4a95e82c2c77b14dce4407923b1f4 100644 (file)
@@ -644,7 +644,7 @@ ssize_t zlog_stream_set_msg_suffix(
        }
        if (suffix != NULL) {
                stream->msg_suffix_len = len = strlen(suffix);
-               stream->msg_suffix = malloc(len);
+               stream->msg_suffix = malloc(len + 1);
                if (stream->msg_suffix == NULL) {
                        return -1;
                }