summaryrefslogtreecommitdiff
blob: d43ef50d101222238ca3905a1a7802b2548db0f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Description: This fixes a use after free and double free if an empty comment
chunk follows a non-empty one.
Author: Mans Rullgard <mans@mansr.com>
Forwarded: not-needed
---
 src/aiff.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: sox/src/aiff.c
===================================================================
--- sox.orig/src/aiff.c
+++ sox/src/aiff.c
@@ -62,7 +62,6 @@ int lsx_aiffstartread(sox_format_t * ft)
   size_t ssndsize = 0;
   char *annotation;
   char *author;
-  char *comment = NULL;
   char *copyright;
   char *nametext;
 
@@ -270,6 +269,7 @@ int lsx_aiffstartread(sox_format_t * ft)
       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 */