--- /dev/null
+https://github.com/libming/libming/commit/6eca133ee9985c298186cbe05f888082c30bf2d9
+
+--- a/util/read.c
++++ b/util/read.c
+@@ -247,6 +247,11 @@ char *readString(FILE *f)
+ if(len >= buflen-2)
+ {
+ buf = (char *)realloc(buf, sizeof(char)*(buflen+256));
++ if ( ! buf )
++ {
++ fprintf(stderr, "failed reallocating %d bytes\n", buflen+256);
++ exit(-1);
++ }
+ buflen += 256;
+ p = buf+len;
+ }
+@@ -350,6 +355,11 @@ char *readSizedString(FILE *f,int size)
+ if(len >= buflen-2)
+ {
+ buf = (char *)realloc(buf, sizeof(char)*(buflen+256));
++ if ( ! buf )
++ {
++ fprintf(stderr, "failed reallocating %d bytes\n", buflen+256);
++ exit(-1);
++ }
+ buflen += 256;
+ p = buf+len;
+ }
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
S=${WORKDIR}/${P//./_}
+PATCHES=( "${FILESDIR}"/${PN}-0.4.8-CVE-2017-8782.patch )
+
# Tests only work when the package is tested on a system
# which does not presently have any version of ming installed.
RESTRICT="test"