From 3c94f4cba175f6fe7c76c9c450dcfe431c06fcb5 Mon Sep 17 00:00:00 2001 From: S Rahul Date: Thu, 15 Oct 2009 12:39:10 +0000 Subject: [PATCH] Fix a memory bug on Linux. Code assumed that the platform is Windows and tried to de-reference an integer thinking that it was a pointer. --- CASA/micasacache/sscs_unx_ipc_client.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CASA/micasacache/sscs_unx_ipc_client.c b/CASA/micasacache/sscs_unx_ipc_client.c index afe208ae..d25191f6 100644 --- a/CASA/micasacache/sscs_unx_ipc_client.c +++ b/CASA/micasacache/sscs_unx_ipc_client.c @@ -299,7 +299,11 @@ int32_t ipc_OpenSecretStore if(retVal < 0) { DMSG(("Write failed : %s\n",strerror(errno))); +#ifdef SSCS_WIN32_PLAT_F DMSG(("Closing socket : %d\n",*(int*)ssHandle->platHandle)); +#else + DMSG(("Closing socket : %d\n", ssHandle->platHandle)); +#endif DMSG(("ipc_OpenSecretStore:IPC_WRITE returned :%d\n",retVal)); IPC_CLOSE(ssHandle->platHandle); retCode = NSSCS_E_SYSTEM_FAILURE; @@ -318,7 +322,11 @@ int32_t ipc_OpenSecretStore //log debug info here DMSG(("ipc_OpenSecretStore:read returned :%d\n",retVal)); DMSG(("Read failed : %s\n",strerror(errno))); +#ifdef SSCS_WIN32_PLAT_F DMSG(("Closing socket : %d\n",*(int*)ssHandle->platHandle)); +#else + DMSG(("Closing socket : %d\n", ssHandle->platHandle)); +#endif IPC_CLOSE(ssHandle->platHandle); retCode = NSSCS_E_SYSTEM_FAILURE; @@ -337,7 +345,11 @@ int32_t ipc_OpenSecretStore if(sockReturn != SSCS_REPLY_SUCCESS) { DMSG(("ipc_OpenSecretStore:sscs returned :%d\n",sockReturn)); +#ifdef SSCS_WIN32_PLAT_F DMSG(("Closing socket : %d\n",*(int*)ssHandle->platHandle)); +#else + DMSG(("Closing socket : %d\n", ssHandle->platHandle)); +#endif IPC_CLOSE(ssHandle->platHandle); retCode = mapReturnCode(sockReturn); break;