Fix off-by-one in environ buffer printing (#75)

This commit is contained in:
Bob Weinand 2019-08-04 21:15:23 +02:00
parent e15edb3330
commit 4b69d0fa2e

View File

@ -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();