[ofw] [PATCH] DAPL v2.0: common: remote ia address null pointer creates seg fault

Davis, Arlin R arlin.r.davis at intel.com
Wed Nov 2 14:34:27 PDT 2011


add NULL ptr check and return DAT_INVALID_PARAMETER, DAT_INVALID_ARG2

Signed-off-by: Arlin Davis <arlin.r.davis at intel.com>
---
 dapl/common/dapl_ep_connect.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/dapl/common/dapl_ep_connect.c b/dapl/common/dapl_ep_connect.c
index 80afead..590d0ed 100755
--- a/dapl/common/dapl_ep_connect.c
+++ b/dapl/common/dapl_ep_connect.c
@@ -81,6 +81,11 @@ dapl_ep_connect(IN DAT_EP_HANDLE ep_handle,
 	DAT_COUNT req_hdr_size;
 	void *private_data_ptr;
 
+	if (remote_ia_address == NULL) {
+		dat_status = DAT_ERROR(DAT_INVALID_PARAMETER, DAT_INVALID_ARG2);
+		goto bail;
+	}
+
 	dapl_dbg_log(DAPL_DBG_TYPE_API | DAPL_DBG_TYPE_CM,
 		     "dapl_ep_connect (%p, {%u.%u.%u.%u}, %X, %d, %d, %p, %x, %x)\n",
 		     ep_handle,
-- 
1.7.3





More information about the ofw mailing list