From: Jeremy Allison Date: Mon, 11 May 2020 19:34:10 +0000 (-0700) Subject: s3: libsmb: In SMB1 old protocol - return NT_STATUS_INVALID_NETWORK_RESPONSE if name... X-Git-Tag: samba-4.11.10~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8f0a185bba2c6b3263e5ca87ebcc9a5fc23c0f6;p=thirdparty%2Fsamba.git s3: libsmb: In SMB1 old protocol - return NT_STATUS_INVALID_NETWORK_RESPONSE if name conversion ended up with a NULL filename. Can happen if namelen == 0. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14374 Signed-off-by: Jeremy Allison Reviewed-by: Andreas Schneider (cherry picked from commit b10de0bb64fe022e6b066584013dfb0bdf2ade96) --- diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c index 4f518339e2b..06a45e221f6 100644 --- a/source3/libsmb/clilist.c +++ b/source3/libsmb/clilist.c @@ -552,7 +552,10 @@ static NTSTATUS cli_list_old_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, TALLOC_FREE(finfo); return NT_STATUS_NO_MEMORY; } - + if (finfo->name == NULL) { + TALLOC_FREE(finfo); + return NT_STATUS_INVALID_NETWORK_RESPONSE; + } status = is_bad_finfo_name(state->cli, finfo); if (!NT_STATUS_IS_OK(status)) { smbXcli_conn_disconnect(state->cli->conn, status);