From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS6130 216.105.38.0/24 X-Spam-Status: No, score=-3.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,SPF_PASS,T_DKIM_INVALID shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 216651F424 for ; Thu, 26 Apr 2018 13:16:31 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1fBgl5-0005dU-Gc; Thu, 26 Apr 2018 13:16:23 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1fBgl4-0005dM-St for sox-devel@lists.sourceforge.net; Thu, 26 Apr 2018 13:16:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=References:In-Reply-To:Message-Id:Date:Subject:To: From:Sender:Reply-To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=517YpndSTU7gk+GEarvY8WDaYTOnQcvKP2NISm8y9lQ=; b=FwKzfEWzBKc06CsztHpAOSmQBH L1ZWZdutAvSco6DJk/56TEJfhMWL/lnit4SQJk3U8mHUWkMqelgF5J/rg77fL1iRA3p0xPEK2BnlG dlF84ypDNVhK0/ezi4Hf2UymufHswr33dCQe6/CBNlj06ZLqS5W2m2roa9yCweTtry1E=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=References:In-Reply-To:Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc :MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=517YpndSTU7gk+GEarvY8WDaYTOnQcvKP2NISm8y9lQ=; b=IiDWVMBpL6dA3rV52BFUkfdwu3 PDjRbGQB7dXX9mtKy3fN/0sBE8NlaoA2scxAvYCiT0gsuP7xaoYxAnT9uD4LTqLmLLWPf/JSF0BUt wWkukdMbKDqa4gMzyIrCiqV0q4MvLeCLekJuhWeOH9zRqCijUWkIwcF2AJ8tymdG44hM=; Received: from unicorn.mansr.com ([81.2.72.234]) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) id 1fBgl3-00Frhs-IT for sox-devel@lists.sourceforge.net; Thu, 26 Apr 2018 13:16:22 +0000 Received: by unicorn.mansr.com (Postfix, from userid 51770) id 6544A16406; Thu, 26 Apr 2018 14:16:11 +0100 (BST) From: Mans Rullgard To: sox-devel@lists.sourceforge.net Date: Thu, 26 Apr 2018 14:15:48 +0100 Message-Id: <20180426131552.29249-5-mans@mansr.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180426131552.29249-1-mans@mansr.com> References: <20180426131552.29249-1-mans@mansr.com> X-Headers-End: 1fBgl3-00Frhs-IT Subject: [PATCH 4/8] wav: ima_adpcm: fix buffer overflow on corrupt input (CVE-2017-15370) X-BeenThere: sox-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sox-devel@lists.sourceforge.net MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: sox-devel-bounces@lists.sourceforge.net Add the same check bad block size as was done for MS adpcm in commit f39c574b ("More checks for invalid MS ADPCM blocks"). --- src/wav.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wav.c b/src/wav.c index eca1cde51ee5..fad334cf56e9 100644 --- a/src/wav.c +++ b/src/wav.c @@ -127,7 +127,7 @@ static unsigned short ImaAdpcmReadBlock(sox_format_t * ft) /* work with partial blocks. Specs say it should be null */ /* padded but I guess this is better than trailing quiet. */ samplesThisBlock = lsx_ima_samples_in((size_t)0, (size_t)ft->signal.channels, bytesRead, (size_t) 0); - if (samplesThisBlock == 0) + if (samplesThisBlock == 0 || samplesThisBlock > wav->samplesPerBlock) { lsx_warn("Premature EOF on .wav input file"); return 0; -- 2.17.0 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ SoX-devel mailing list SoX-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sox-devel