From 4b69d0fa2e4446bfa9343172227e8351da421dff Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Sun, 4 Aug 2019 21:15:23 +0200 Subject: [PATCH] Fix off-by-one in environ buffer printing (#75) --- php_uv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php_uv.c b/php_uv.c index 90ed785..91bd8ab 100644 --- a/php_uv.c +++ b/php_uv.c @@ -5114,7 +5114,7 @@ PHP_FUNCTION(uv_spawn) char *tmp_env_entry; tmp_env_entry = emalloc(sizeof(char) * (key->len + 2 + Z_STRLEN_P(value))); - slprintf(tmp_env_entry, key->len + 1 + Z_STRLEN_P(value), "%s=%s", key->val, Z_STRVAL_P(value)); + slprintf(tmp_env_entry, key->len + 2 + Z_STRLEN_P(value), "%s=%s", key->val, Z_STRVAL_P(value)); zenv[i++] = tmp_env_entry; } ZEND_HASH_FOREACH_END();