diff options
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -2206,7 +2206,12 @@ ruby_setenv(const char *name, const char *value) rb_sys_fail("ruby_setenv"); } if (value) { - if (strlen(value) > 5120) goto fail; + char* p = GetEnvironmentStringsA(); + if (p) { + if (strlen(value) + strlen(p) >= 32767) goto fail; + } else { + if (strlen(value) >= 5120) goto fail; + } buf = rb_sprintf("%s=%s", name, value); } else { |