From: Andreas Schneider Date: Fri, 16 Jan 2009 20:26:46 +0000 (-0800) Subject: Fix a segfault if ? is there but the options are NULL. This is the case if SMBC_parse... X-Git-Tag: samba-4.0.0alpha6~50 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3fe974c4feed33187294a0cb922c20f7dbfeaf43;p=thirdparty%2Fsamba.git Fix a segfault if ? is there but the options are NULL. This is the case if SMBC_parse_path is called by SMBC_stat_ctx. --- diff --git a/source3/libsmb/libsmb_path.c b/source3/libsmb/libsmb_path.c index 2c3a5f8866b..b0970d46db4 100644 --- a/source3/libsmb/libsmb_path.c +++ b/source3/libsmb/libsmb_path.c @@ -286,7 +286,7 @@ SMBC_parse_path(TALLOC_CTX *ctx, DEBUG(4, ("Found options '%s'", q)); /* Copy the options */ - if (*pp_options != NULL) { + if (pp_options && *pp_options != NULL) { TALLOC_FREE(*pp_options); *pp_options = talloc_strdup(ctx, q); }