diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2006-07-16 01:15:29 +0300 |
---|---|---|
committer | Steve Peters <steve@fisharerojo.org> | 2006-07-16 13:46:35 +0000 |
commit | 1bdfa2dec136126216e8edf2320ed0ca1f645494 (patch) | |
tree | 2743a3d2296f5d5eb59790adcb3468d2a2270df6 /util.c | |
parent | 5a2bdfd0e906359696ca0db94c49d11f3999e99b (diff) | |
download | perl-1bdfa2dec136126216e8edf2320ed0ca1f645494.tar.gz |
Re: [PATCH] various safety/portability tweaks
Message-ID: <44B93ED1.7080000@iki.fi>
Fix for change #28578.
p4raw-link: @28578 on //depot/perl: d130778686fc2c04eb7d731512df9e71304d5573
p4raw-id: //depot/perl@28585
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -5465,11 +5465,10 @@ Perl_my_clearenv(pTHX) int l = e ? e - *environ : strlen(*environ); if (bsiz < l + 1) { (void)safesysfree(buf); - bsiz = l + 1; + bsiz = l + 1; /* + 1 for the \0. */ buf = (char*)safesysmalloc(bufsiz); } - my_strlcpy(buf, bufsiz, *environ, l); - *(buf + l) = '\0'; + my_strlcpy(buf, *environ, l + 1); (void)unsetenv(buf); } (void)safesysfree(buf); |