Change 28585 by [EMAIL PROTECTED] on 2006/07/16 13:46:35
[PATCH] Re: [PATCH] various safety/portability tweaks
From: Jarkko Hietaniemi <[EMAIL PROTECTED]>
Date: Sat, 15 Jul 2006 22:15:29 +0300
Message-ID: <[EMAIL PROTECTED]>
Fix for change #28578.
Affected files ...
... //depot/perl/util.c#576 edit
Differences ...
==== //depot/perl/util.c#576 (text) ====
Index: perl/util.c
--- perl/util.c#575~28578~ 2006-07-15 04:53:36.000000000 -0700
+++ perl/util.c 2006-07-16 06:46:35.000000000 -0700
@@ -5465,11 +5465,10 @@
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);
End of Patch.