From: Pierre Joye Date: Thu, 4 Feb 2010 09:08:57 +0000 (+0000) Subject: - #50690, putenv does assign value when their length is one char on windows X-Git-Tag: php-5.3.2RC2~54 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=39ff9ec3ec73e38027fd7e2b486d39e4f98c3ca6;p=php - #50690, putenv does assign value when their length is one char on windows --- diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index c3693f74b8..5c2c23e5b0 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -4056,7 +4056,7 @@ PHP_FUNCTION(putenv) pe.key_len = strlen(pe.key); #ifdef PHP_WIN32 if (equals) { - if (pe.key_len < setting_len - 2) { + if (pe.key_len < setting_len - 1) { value = p + 1; } else { /* empty string*/ diff --git a/ext/standard/tests/general_functions/bug50690.phpt b/ext/standard/tests/general_functions/bug50690.phpt new file mode 100644 index 0000000000..4d9f0dc5ee --- /dev/null +++ b/ext/standard/tests/general_functions/bug50690.phpt @@ -0,0 +1,14 @@ +--TEST-- +Bug #23650 (putenv() does not assign values when the value is one character) +--FILE-- + +--EXPECT-- +string(2) "ab" +string(1) "c" +bool(false)