From patchwork Thu Jul 2 14:21:05 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ameya Palande X-Patchwork-Id: 33681 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n62EM9P2003708 for ; Thu, 2 Jul 2009 14:22:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753483AbZGBOV4 (ORCPT ); Thu, 2 Jul 2009 10:21:56 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754139AbZGBOV4 (ORCPT ); Thu, 2 Jul 2009 10:21:56 -0400 Received: from smtp.nokia.com ([192.100.122.230]:42689 "EHLO mgw-mx03.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753483AbZGBOV4 (ORCPT ); Thu, 2 Jul 2009 10:21:56 -0400 Received: from esebh106.NOE.Nokia.com (esebh106.ntc.nokia.com [172.21.138.213]) by mgw-mx03.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n62ELii5030536; Thu, 2 Jul 2009 17:21:51 +0300 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by esebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 2 Jul 2009 17:21:13 +0300 Received: from mgw-da02.ext.nokia.com ([147.243.128.26]) by vaebh104.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Thu, 2 Jul 2009 17:21:12 +0300 Received: from localhost.localdomain (esdhcp041160.research.nokia.com [172.21.41.160]) by mgw-da02.ext.nokia.com (Switch-3.2.6/Switch-3.2.6) with ESMTP id n62EL582006485; Thu, 2 Jul 2009 17:21:06 +0300 From: Ameya Palande To: linux-omap@vger.kernel.org Cc: x0095840@ti.com, h-kanigeri2@ti.com, ext-phil.2.carmody@nokia.com Subject: [PATCH 1/4] DSPBRIDGE: always malloc strlen+1 for the trailing \0 Date: Thu, 2 Jul 2009 17:21:05 +0300 Message-Id: <1246544468-14546-1-git-send-email-ameya.palande@nokia.com> X-Mailer: git-send-email 1.6.2.4 X-OriginalArrivalTime: 02 Jul 2009 14:21:12.0590 (UTC) FILETIME=[5A1942E0:01C9FB20] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org From: Phil Carmody Array member [pathSize] is set to \0, so the array must be pathSize+1 bytes in size. Signed-off-by: Phil Carmody --- drivers/dsp/bridge/pmgr/wcd.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/dsp/bridge/pmgr/wcd.c b/drivers/dsp/bridge/pmgr/wcd.c index 86812c6..7732492 100644 --- a/drivers/dsp/bridge/pmgr/wcd.c +++ b/drivers/dsp/bridge/pmgr/wcd.c @@ -530,7 +530,7 @@ u32 MGRWRAP_RegisterObject(union Trapped_Args *args) goto func_end; pathSize = strlen_user((char *) args->ARGS_MGR_REGISTEROBJECT.pszPathName); - pszPathName = MEM_Alloc(pathSize, MEM_NONPAGED); + pszPathName = MEM_Alloc(pathSize + 1, MEM_NONPAGED); if (!pszPathName) goto func_end; retVal = strncpy_from_user(pszPathName,