summaryrefslogtreecommitdiff
path: root/graphics/png/files
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>2004-05-02 21:24:14 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>2004-05-02 21:24:14 +0000
commit785843deac1e6121fef1205c4b455c38c6bb6e40 (patch)
treec5fb7f0c31c2b4a04995691dd61c9f6932b3b9a0 /graphics/png/files
parentPut the pkg-message template back into PKGDIR. (diff)
Fix potential out of bounds copy from the string.
Notes
Notes: svn path=/head/; revision=108211
Diffstat (limited to 'graphics/png/files')
-rw-r--r--graphics/png/files/patch-ac19
1 files changed, 19 insertions, 0 deletions
diff --git a/graphics/png/files/patch-ac b/graphics/png/files/patch-ac
new file mode 100644
index 000000000000..c43f263aec03
--- /dev/null
+++ b/graphics/png/files/patch-ac
@@ -0,0 +1,19 @@
+--- pngerror.c.orig Thu Oct 3 15:32:27 2002
++++ pngerror.c Mon May 3 01:18:27 2004
+@@ -135,10 +135,14 @@
+ buffer[iout] = 0;
+ else
+ {
++ int len = strlen(error_message);
++
++ if (len > 63)
++ len = 63;
+ buffer[iout++] = ':';
+ buffer[iout++] = ' ';
+- png_memcpy(buffer+iout, error_message, 64);
+- buffer[iout+63] = 0;
++ png_memcpy(buffer+iout, error_message, len);
++ buffer[iout+len] = 0;
+ }
+ }
+