From 918c3ebe32aacee82fe354d5b9b7ea4d477dcfda Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 24 Jan 2001 19:04:56 +0000 Subject: smbd/lanman.c: Fix for calling qsort with 0 number. smbd/nttrans.c: Realloc mem fixes based on those that went into trans2.c smbd/process.c: Move to a table based dispatch, based on a comment from Andrew about Antons work. Jeremy. (This used to be commit a958f7822e095367efb8749b6f1f2e110ffb8866) --- source3/smbd/nttrans.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'source3/smbd/nttrans.c') diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index c0ccea0add..3aaaa9aebb 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -1024,10 +1024,12 @@ static int do_nt_transact_create_pipe( connection_struct *conn, return ret; /* Realloc the size of parameters and data we will return */ - params = *ppparams = Realloc(*ppparams, 69); + params = Realloc(*ppparams, 69); if(params == NULL) return(ERROR(ERRDOS,ERRnomem)); + *ppparams = params; + memset((char *)params,'\0',69); p = params; @@ -1337,10 +1339,12 @@ static int call_nt_transact_create(connection_struct *conn, restore_case_semantics(file_attributes); /* Realloc the size of parameters and data we will return */ - params = *ppparams = Realloc(*ppparams, 69); + params = Realloc(*ppparams, 69); if(params == NULL) return(ERROR(ERRDOS,ERRnomem)); + *ppparams = params; + memset((char *)params,'\0',69); p = params; @@ -1520,10 +1524,12 @@ static int call_nt_transact_query_security_desc(connection_struct *conn, DEBUG(3,("call_nt_transact_query_security_desc: file = %s\n", fsp->fsp_name )); - params = *ppparams = Realloc(*ppparams, 4); + params = Realloc(*ppparams, 4); if(params == NULL) return(ERROR(ERRDOS,ERRnomem)); + *ppparams = params; + /* * Get the permissions to return. */ @@ -1548,12 +1554,14 @@ static int call_nt_transact_query_security_desc(connection_struct *conn, * Allocate the data we will point this at. */ - data = *ppdata = Realloc(*ppdata, sd_size); + data = Realloc(*ppdata, sd_size); if(data == NULL) { free_sec_desc(&psd); return(ERROR(ERRDOS,ERRnomem)); } + *ppdata = data; + memset(data, '\0', sd_size); /* -- cgit