From patchwork Thu Jul 25 13:09:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregor Jasny X-Patchwork-Id: 2833394 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1ADEB9F4D4 for ; Thu, 25 Jul 2013 13:10:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4FDCD20202 for ; Thu, 25 Jul 2013 13:10:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EC3B62020F for ; Thu, 25 Jul 2013 13:10:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755695Ab3GYNKh (ORCPT ); Thu, 25 Jul 2013 09:10:37 -0400 Received: from mail-bk0-f42.google.com ([209.85.214.42]:55000 "EHLO mail-bk0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755642Ab3GYNKg (ORCPT ); Thu, 25 Jul 2013 09:10:36 -0400 Received: by mail-bk0-f42.google.com with SMTP id jk13so679640bkc.1 for ; Thu, 25 Jul 2013 06:10:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=U647F3GdIJKUaNMszeDHCs3D9b4f+1p45M5qD42n9IU=; b=Pr0WgfP5PAoVHC7BkE/2Xe0a/5KtUHiHyUIunakpVwUN30zHetR1a8a1vrt4CJdBTE YrJ8E/vBQ24rtRoaANtgYr+rhEL9VMRknl0SAWHrsZlsSpr25tjwnjB7i7fw9+jcxZEX bxDu03HTzDxkA246xfIqMmy5O8mYK7J/irKmU7smsAzIfKgMlkxoAWsul2ylHtmdWp0Z b4zYAEggWBHnUZRcYsAbt1ieU0NE3xxL75w6kSfFKBXnf8ycowoSUzUc6OUdLyHASSy1 JjWqg206tO4Yxftmob7E/Am0k0DBaVx3B1ZtQlEJSEKJe81d+zGJUphnp5N+5iGNJf8u 1wfA== X-Received: by 10.205.116.1 with SMTP id fg1mr6238094bkc.169.1374757835119; Thu, 25 Jul 2013 06:10:35 -0700 (PDT) Received: from gjasny06.drs.expertcity.com ([78.108.113.8]) by mx.google.com with ESMTPSA id eu16sm10949773bkc.0.2013.07.25.06.10.33 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 06:10:34 -0700 (PDT) From: Gregor Jasny To: linux-media@vger.kernel.org Cc: Gregor Jasny , Mauro Carvalho Chehab Subject: [PATCH 1/4] xc3082: Fix use after free in free_firmware() Date: Thu, 25 Jul 2013 15:09:31 +0200 Message-Id: <1374757774-29051-2-git-send-email-gjasny@googlemail.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1374757774-29051-1-git-send-email-gjasny@googlemail.com> References: <1374757774-29051-1-git-send-email-gjasny@googlemail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Detected by Coverity Scanner. CC: Mauro Carvalho Chehab Signed-off-by: Gregor Jasny --- utils/xc3028-firmware/firmware-tool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/xc3028-firmware/firmware-tool.c b/utils/xc3028-firmware/firmware-tool.c index b2e9de4..a7850df 100644 --- a/utils/xc3028-firmware/firmware-tool.c +++ b/utils/xc3028-firmware/firmware-tool.c @@ -86,13 +86,13 @@ static struct firmware* alloc_firmware(void) { static void free_firmware(struct firmware *f) { free(f->name); - free(f->desc); if(f->desc) { unsigned int i = 0; for(i = 0; i < f->nr_desc; ++ i) { free(f->desc[i].data); } } + free(f->desc); free(f); }