[prev in list] [next in list] [prev in thread] [next in thread] 

List:       trousers-tech
Subject:    Re: [TrouSerS-tech] [PATCH 15/17] Prevents dereference of null when call TCSP_NV_WriteValueAuth_Inte
From:       "Fuchs, Andreas" <andreas.fuchs () sit ! fraunhofer ! de>
Date:       2014-04-11 9:52:41
Message-ID: 1397209961.15139.41.camel () pc-fuchslap2 ! sit ! fraunhofer ! de
[Download RAW message or body]

Disclaimer:
I could not complie-test or runtime-test these patches right now. This is a pure \
code-only review of the patches.

Looks good.

Am Mittwoch, den 09.04.2014, 15:41 -0300 schrieb rmaciel@linux.vnet.ibm.com:
> From: Richard Maciel <rmaciel@linux.vnet.ibm.com>
> 
> Related to coverity CID: 10290
> 
> pAuth variable could set to NULL in some cases, which, when passed
> to the aforementioned function would result in a dereference of NULL.
> 
> Signed-off-by: Richard Maciel <rmaciel@linux.vnet.ibm.com>
> ---
> src/tcs/rpc/tcstp/rpc_nv.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/src/tcs/rpc/tcstp/rpc_nv.c b/src/tcs/rpc/tcstp/rpc_nv.c
> index a44f51a..a54fb48 100644
> --- a/src/tcs/rpc/tcstp/rpc_nv.c
> +++ b/src/tcs/rpc/tcstp/rpc_nv.c
> @@ -189,9 +189,10 @@ tcs_wrap_NV_WriteValueAuth(struct tcsd_thread_data *data)
> 		free(rgbDataToWrite);
> 		return TCSERR(TSS_E_INTERNAL_ERROR);
> 	}
> -	if (getData(TCSD_PACKET_TYPE_AUTH, 5, &Auth, 0, &data->comm))
> -		pAuth = NULL;
> -	else
> +	if (getData(TCSD_PACKET_TYPE_AUTH, 5, &Auth, 0, &data->comm)) {
> +		free(rgbDataToWrite);
> +		return TCSERR(TSS_E_INTERNAL_ERROR);
> +	} else
> 		pAuth = &Auth;
> 
> 	MUTEX_LOCK(tcsp_lock);

------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment 
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
TrouSerS-tech mailing list
TrouSerS-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/trousers-tech


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic