Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hello,i find a memory leak bug in imagemagick,the details is on the Steps to Reproduce.
the bug located in meta.c ,static ssize_t parse8BIM(Image *ifile, Image *ofile) function the bug code is on https://github.com/ImageMagick/ImageMagick/blob/master/coders/meta.c#L327 the code fragment is as follows:
line = (char *) AcquireQuantumMemory((size_t) inputlen,sizeof(*line)); //llocate a memory and assigned it to line if (line == (char *) NULL) return(-1); newstr = name = token = (char *) NULL; savedpos = 0; token_info=AcquireTokenInfo();
we can see that we allocate a memory and assigned it to line,but we forget to free it in the code: https://github.com/ImageMagick/ImageMagick/blob/master/coders/meta.c#L436 the code is as follows:
if (savedolen > 0) { MagickOffsetType offset; ssize_t diff = outputlen - savedolen; currentpos = TellBlob(ofile); if (currentpos < 0) return(-1); // return without free line pointed memory offset=SeekBlob(ofile,savedpos,SEEK_SET); if (offset < 0) return(-1); // return without free line pointed memory (void) WriteBlobMSBLong(ofile,(unsigned int) diff); offset=SeekBlob(ofile,currentpos,SEEK_SET); if (offset < 0) return(-1); savedolen = 0L; }
credit:www.vackbot.com(墨云科技)
The text was updated successfully, but these errors were encountered:
https://github.com/ImageMagick/ImageMagick/issues/1190
082223f
0812674
Thanks for the problem report. We can reproduce it and will have a patch to fix it in GIT master branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ http://www.imagemagick.org/download/beta/ by sometime tomorrow.
Sorry, something went wrong.
@urban-warrior ,will this bug be assigned a cve?
This was assigned CVE-2018-14437.
No branches or pull requests
Prerequisites
Description
hello,i find a memory leak bug in imagemagick,the details is on the Steps to Reproduce.
Steps to Reproduce
the bug located in meta.c ,static ssize_t parse8BIM(Image *ifile, Image *ofile) function
the bug code is on
https://github.com/ImageMagick/ImageMagick/blob/master/coders/meta.c#L327
the code fragment is as follows:
we can see that we allocate a memory and assigned it to line,but we forget to free it in the code:
https://github.com/ImageMagick/ImageMagick/blob/master/coders/meta.c#L436
the code is as follows:
credit:www.vackbot.com(墨云科技)
The text was updated successfully, but these errors were encountered: