summaryrefslogtreecommitdiff
path: root/lang/php5/patches/patch-am
diff options
context:
space:
mode:
Diffstat (limited to 'lang/php5/patches/patch-am')
-rw-r--r--lang/php5/patches/patch-am28
1 files changed, 28 insertions, 0 deletions
diff --git a/lang/php5/patches/patch-am b/lang/php5/patches/patch-am
new file mode 100644
index 00000000000..248c955a0d5
--- /dev/null
+++ b/lang/php5/patches/patch-am
@@ -0,0 +1,28 @@
+$NetBSD: patch-am,v 1.3 2007/06/07 10:45:18 adrianp Exp $
+
+--- ext/standard/string.c.orig 2007-05-30 01:33:13.000000000 +0100
++++ ext/standard/string.c
+@@ -1956,18 +1956,20 @@ static char *php_chunk_split(char *src,
+ char *p, *q;
+ int chunks; /* complete chunks! */
+ int restlen;
+- int out_len;
++ float out_len;
+
+ chunks = srclen / chunklen;
+ restlen = srclen - chunks * chunklen; /* srclen % chunklen */
+
+- out_len = (srclen + (chunks + 1) * endlen + 1);
++ out_len = chunks + 1;
++ out_len *= endlen;
++ out_len += srclen + 1;
+
+ if (out_len > INT_MAX || out_len <= 0) {
+ return NULL;
+ }
+
+- dest = safe_emalloc(out_len, sizeof(char), 0);
++ dest = safe_emalloc((int)out_len, sizeof(char), 0);
+
+ for (p = src, q = dest; p < (src + srclen - chunklen + 1); ) {
+ memcpy(q, p, chunklen);