[PATCH 1/4] DSPBRIDGE: always malloc strlen+1 for the trailing \0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Phil Carmody <ext-phil.2.carmody@xxxxxxxxx>

Array member [pathSize] is set to \0, so the array must be
pathSize+1 bytes in size.

Signed-off-by: Phil Carmody <ext-phil.2.carmody@xxxxxxxxx>
---
 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,
-- 
1.6.2.4

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux