Skip to content
New issue

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

Null Pointer Dereference in PDFDelegateMessage #724

Closed
jgj212 opened this issue Sep 3, 2017 · 2 comments
Closed

Null Pointer Dereference in PDFDelegateMessage #724

jgj212 opened this issue Sep 3, 2017 · 2 comments
Labels

Comments

@jgj212
Copy link
Contributor

jgj212 commented Sep 3, 2017

ImageMagick 7.0.7-0 Q16 x86_64

Here is the critical code:

  if (*messages == (char *) NULL) 
    *messages=(char *) AcquireQuantumMemory(length+1,sizeof(char *));	//141
  else
    {
      offset=strlen(*messages);
      *messages=(char *) ResizeQuantumMemory(*messages,offset+length+1,
        sizeof(char *));
    }
  (void) memcpy(*messages+offset,message,length);
  (*messages)[length+offset] ='\0';
  return(length);

AcquireQuantumMemory(...) may return NULL, so (*messages)[length+offset] will Dereference Null pointer to cause memory error.

Credit: ADLab of Venustech

@mikayla-grace
Copy link

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 @ https://www.imagemagick.org/download/beta/ by sometime tomorrow.

@dlemstra dlemstra added the bug label Sep 3, 2017
@dlemstra dlemstra closed this as completed Sep 3, 2017
@nohmask
Copy link

nohmask commented Oct 4, 2017

This was assigned CVE-2017-15015.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants