From: Volker Lendecke Date: Thu, 23 Oct 2025 17:26:27 +0000 (+0200) Subject: smbd: README.Coding for file_name_hash() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff5649a25ed00b5e6f9e0ad11d78467b493fc389;p=thirdparty%2Fsamba.git smbd: README.Coding for file_name_hash() Initialize pointers Signed-off-by: Volker Lendecke Reviewed-by: Anoop C S --- diff --git a/source3/smbd/files.c b/source3/smbd/files.c index 3c03f7b8dd3..38270779bc0 100644 --- a/source3/smbd/files.c +++ b/source3/smbd/files.c @@ -2582,9 +2582,9 @@ static NTSTATUS file_name_hash(connection_struct *conn, uint32_t *p_name_hash) { char tmpbuf[PATH_MAX]; - char *fullpath, *to_free; + char *fullpath = NULL, *to_free = NULL; ssize_t len; - TDB_DATA key; + TDB_DATA key = {.dptr = NULL}; /* Set the hash of the full pathname. */ @@ -2592,7 +2592,6 @@ static NTSTATUS file_name_hash(connection_struct *conn, strlcpy(tmpbuf, name, sizeof(tmpbuf)); fullpath = tmpbuf; len = strlen(fullpath); - to_free = NULL; } else { len = full_path_tos(conn->connectpath, name,