From e4065db32bc2a57c3c6803ea9495152ab2d854d0 Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Sun, 24 Jan 2010 13:49:47 +0000 Subject: [PATCH] - #50690, putenv does assign value when their length is one char --- ext/standard/basic_functions.c | 2 +- ext/standard/tests/general_functions/bug50690.phpt | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 ext/standard/tests/general_functions/bug50690.phpt diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 33ca9b7e1c..38c608f670 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) -- 2.40.0