[PATCH] Fix a possible null pointer deref in talloc report

Jeremy Allison jra at samba.org
Wed Jun 22 16:50:42 UTC 2016


On Wed, Jun 22, 2016 at 09:19:03AM +0200, Andreas Schneider wrote:
> Review and push appreciated!

LGTM. Pushed.



> 	-- andreas
> 
> -- 
> Andreas Schneider                   GPG-ID: CC014E3D
> Samba Team                             asn at samba.org
> www.samba.org

> From d80e541e3cb35db46affac56ea87bff7f15d6f8d Mon Sep 17 00:00:00 2001
> From: Andreas Schneider <asn at samba.org>
> Date: Wed, 22 Jun 2016 09:17:07 +0200
> Subject: [PATCH] util: Fix a possible null pointer dereference
> 
> Found by cppcheck.
> 
> Signed-off-by: Andreas Schneider <asn at samba.org>
> ---
>  lib/util/talloc_report.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/lib/util/talloc_report.c b/lib/util/talloc_report.c
> index 9b98347..018d9ab 100644
> --- a/lib/util/talloc_report.c
> +++ b/lib/util/talloc_report.c
> @@ -40,6 +40,9 @@ static char *talloc_vasprintf_append_largebuf(char *buf, ssize_t *pstr_len,
>  	if (buf == NULL) {
>  		return NULL;
>  	}
> +	if (fmt == NULL) {
> +		return NULL;
> +	}
>  	buflen = talloc_get_size(buf);
>  
>  	if (buflen > str_len) {
> -- 
> 2.9.0
> 




More information about the samba-technical mailing list