You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/media-libs/ming/files/ming-0.4.8-CVE-2017-8782.patch

29 lines
772 B

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;
}