summaryrefslogtreecommitdiff
path: root/source3/smbd/nttrans.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-12-27 20:45:12 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:16:44 -0500
commitb26a9ad9dfe2976ae1f6c31b270bdcd7818172c3 (patch)
tree1b19977cd21ac274437693b510c0abb04e4e3175 /source3/smbd/nttrans.c
parentae7526fd55741ecbb0bd90d47a18578f0baafe87 (diff)
downloadsamba-b26a9ad9dfe2976ae1f6c31b270bdcd7818172c3.tar.gz
samba-b26a9ad9dfe2976ae1f6c31b270bdcd7818172c3.tar.bz2
samba-b26a9ad9dfe2976ae1f6c31b270bdcd7818172c3.zip
r20363: Fix any possible valgrind errors in srvstr_get_XX or srvstr_pull_XX
by ensuring we pass in a valid src_len (or zero when appropriate). Volker is correct in that this is a *horrible* interface and he is now free to generally clean it up everywhere :-). Go for it Volker ! Jeremy. (This used to be commit cd991fb839994dd29dc790b655f5597fa1e12843)
Diffstat (limited to 'source3/smbd/nttrans.c')
-rw-r--r--source3/smbd/nttrans.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index 377ddbeec3..68c5b46189 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -1865,14 +1865,14 @@ static int call_nt_transact_rename(connection_struct *conn, char *inbuf, char *o
BOOL path_contains_wcard = False;
NTSTATUS status;
- if(parameter_count < 4) {
+ if(parameter_count < 5) {
return ERROR_DOS(ERRDOS,ERRbadfunc);
}
fsp = file_fsp(params, 0);
replace_if_exists = (SVAL(params,2) & RENAME_REPLACE_IF_EXISTS) ? True : False;
CHECK_FSP(fsp, conn);
- srvstr_get_path_wcard(inbuf, new_name, params+4, sizeof(new_name), -1, STR_TERMINATE, &status, &path_contains_wcard);
+ srvstr_get_path_wcard(inbuf, new_name, params+4, sizeof(new_name), parameter_count - 4, STR_TERMINATE, &status, &path_contains_wcard);
if (!NT_STATUS_IS_OK(status)) {
return ERROR_NT(status);
}