Skip to content

Commit 45f5965

Browse files
committed
* 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
1 parent d504a24 commit 45f5965

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

ChangeLog

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
Tue Mar 8 16:45:31 2011 NAKAMURA Usaku <usa@ruby-lang.org>
2+
3+
* hash.c (ruby_setenv): MSDN says that Windows XP or earlier limits
4+
the total size of environment block to 5,120 chars. and on such
5+
OS, putenv() causes SEGV. So, ruby should limit the size of an
6+
environment variable to 5,120 bytes for workaround.
7+
18
Tue Mar 8 15:57:20 2011 NAKAMURA Usaku <usa@ruby-lang.org>
29

310
* test/rubygems/test_gem_spec_fetcher.rb

hash.c

+1
Original file line numberDiff line numberDiff line change
@@ -2206,6 +2206,7 @@ ruby_setenv(const char *name, const char *value)
22062206
rb_sys_fail("ruby_setenv");
22072207
}
22082208
if (value) {
2209+
if (strlen(value) > 5120) goto fail;
22092210
buf = rb_sprintf("%s=%s", name, value);
22102211
}
22112212
else {

0 commit comments

Comments
 (0)