summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-08 07:52:19 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-08 07:52:19 +0000
commit45f59656ae27864c2ffe4f932e413059e425fed4 (patch)
tree00ea560ae2feda5e7a8b1b2f3b3d9a9d70d639ba /hash.c
parentd504a2458c14d25dee796a1e59b8c83bf8f3e186 (diff)
* hash.c (ruby_setenv): MSDN says that Windows XP or earlier limits
the total size of environment block to 5,120 chars. and on such OS, putenv() causes SEGV. So, ruby should limit the size of an environment variable to 5,120 bytes for workaround. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hash.c b/hash.c
index 909263357a..f86152ae70 100644
--- a/hash.c
+++ b/hash.c
@@ -2206,6 +2206,7 @@ ruby_setenv(const char *name, const char *value)
rb_sys_fail("ruby_setenv");
}
if (value) {
+ if (strlen(value) > 5120) goto fail;
buf = rb_sprintf("%s=%s", name, value);
}
else {