From 0be259eaa9ce3f3fa587a3ef0cf2c0b9c73167a2 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Mon, 20 Nov 2017 11:03:15 +0000 Subject: [PATCH] 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. --- src/aiff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aiff.c b/src/aiff.c index e34286be..197ccd4e 100644 --- a/src/aiff.c +++ b/src/aiff.c @@ -63,7 +63,6 @@ int lsx_aiffstartread(sox_format_t * ft) size_t ssndsize = 0; char *annotation; char *author; - char *comment = NULL; char *copyright; char *nametext; @@ -271,6 +270,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 */