Skip to content
Permalink
Browse files

gettext: fix crash due to buffer overflow

  • Loading branch information
jmroot committed Apr 10, 2019
1 parent 7b8421c commit a4c79a0b578a7c230518cb8408e5653b5bef430d
Showing with 15 additions and 0 deletions.
  1. +4 −0 devel/gettext/Portfile
  2. +11 −0 devel/gettext/files/write-java.c.patch
@@ -7,6 +7,7 @@ PortGroup muniversal 1.0
name gettext
epoch 2
version 0.19.8.1
revision 1
categories devel
maintainers ryandesign
# libs are LGPL and executables are GPL
@@ -23,6 +24,9 @@ long_description ${name} is the ${description}, used for writing multilin
checksums rmd160 29a5f29d186fe2aece5c450fd1a743b819c02c5b \
sha256 ff942af0e438ced4a8b0ea4b0b6e0d6d657157c5e2364de57baa279c1c125c43

# https://trac.macports.org/ticket/58323
patchfiles write-java.c.patch

# https://trac.macports.org/ticket/31167
compiler.blacklist-append {clang < 211.10.1}

@@ -0,0 +1,11 @@
--- gettext-tools/src/write-java.c.orig 2016-03-20 18:37:53.000000000 +1100
+++ gettext-tools/src/write-java.c 2019-04-10 22:00:47.000000000 +1000
@@ -150,7 +150,7 @@ msgid_hashcode (const char *msgctxt, con
char *combined;
unsigned int result;

- combined = (char *) xmalloca (combined_len);
+ combined = (char *) xmalloca (combined_len+1);
memcpy (combined, msgctxt, msgctxt_len);
combined[msgctxt_len] = MSGCTXT_SEPARATOR;
memcpy (combined + msgctxt_len + 1, msgid, msgid_len + 1);

0 comments on commit a4c79a0

Please sign in to comment.
You can’t perform that action at this time.