shithub: sox

Download patch

ref: f56c0dbca8f5bd02ea88970c248c0d087386e807
parent: 515b986139183326cc40c67c75f83edc60826a9e
author: Mans Rullgard <mans@mansr.com>
date: Mon Nov 20 06:03:15 EST 2017

aiff: fix crash on empty comment chunk (CVE-2017-15642)

This fixes a use after free and double free if an empty comment
chunk follows a non-empty one.

--- a/src/aiff.c
+++ b/src/aiff.c
@@ -62,7 +62,6 @@
   size_t ssndsize = 0;
   char *annotation;
   char *author;
-  char *comment = NULL;
   char *copyright;
   char *nametext;
 
@@ -270,6 +269,7 @@
       free(annotation);
     }
     else if (strncmp(buf, "COMT", (size_t)4) == 0) {
+      char *comment = NULL;
       rc = commentChunk(&comment, "Comment:", ft);
       if (rc) {
         /* Fail already called in function */