From patchwork Wed Jan 5 15:37:31 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 453691 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p05FbOLw011997 for ; Wed, 5 Jan 2011 15:37:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751340Ab1AEPhf (ORCPT ); Wed, 5 Jan 2011 10:37:35 -0500 Received: from mail-yi0-f46.google.com ([209.85.218.46]:43164 "EHLO mail-yi0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751260Ab1AEPhf (ORCPT ); Wed, 5 Jan 2011 10:37:35 -0500 Received: by mail-yi0-f46.google.com with SMTP id 18so3835203yib.19 for ; Wed, 05 Jan 2011 07:37:35 -0800 (PST) Received: by 10.100.242.18 with SMTP id p18mr3341747anh.224.1294241854892; Wed, 05 Jan 2011 07:37:34 -0800 (PST) Received: from salusa.poochiereds.net (cpe-071-070-153-003.nc.res.rr.com [71.70.153.3]) by mx.google.com with ESMTPS id 35sm30984884ano.11.2011.01.05.07.37.34 (version=SSLv3 cipher=RC4-MD5); Wed, 05 Jan 2011 07:37:34 -0800 (PST) From: Jeff Layton To: linux-cifs@vger.kernel.org Cc: Stefan Walter Subject: [PATCH] cifs.upcall: fix crash when trying to free uninitialized var Date: Wed, 5 Jan 2011 10:37:31 -0500 Message-Id: <1294241851-10013-1-git-send-email-jlayton@samba.org> X-Mailer: git-send-email 1.7.3.4 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 05 Jan 2011 15:37:35 +0000 (UTC) diff --git a/cifs.upcall.c b/cifs.upcall.c index 1ffcd7c..34b0638 100644 --- a/cifs.upcall.c +++ b/cifs.upcall.c @@ -677,6 +677,7 @@ int main(const int argc, char *const argv[]) const char *oid; hostbuf[0] = '\0'; + memset(&arg, 0, sizeof(arg)); openlog(prog, 0, LOG_DAEMON); @@ -731,8 +732,6 @@ int main(const int argc, char *const argv[]) goto out; } - memset(&arg, 0, sizeof(arg)); - have = decode_key_description(buf, &arg); SAFE_FREE(buf); if ((have & DKD_MUSTHAVE_SET) != DKD_MUSTHAVE_SET) {