From 33b9c6c08b1a6db07b23ef9ded9864998af2efd9 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 11 May 2020 12:09:29 -0700 Subject: [PATCH] s3: libsmb: A directory entry from an SMB1/SMB2 server must have a name. Add in a missing NULL pointer check in is_bad_finfo_name(). BUG: https://bugzilla.samba.org/show_bug.cgi?id=14374 Signed-off-by: Jeremy Allison --- source3/libsmb/clilist.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c index f868e72a239..c0e2ef5717e 100644 --- a/source3/libsmb/clilist.c +++ b/source3/libsmb/clilist.c @@ -64,6 +64,10 @@ NTSTATUS is_bad_finfo_name(const struct cli_state *cli, NTSTATUS status = NT_STATUS_OK; bool windows_names = true; + if (finfo->name == NULL) { + /* Can't have a missing directory name. */ + return NT_STATUS_INVALID_NETWORK_RESPONSE; + } if (cli->requested_posix_capabilities & CIFS_UNIX_POSIX_PATHNAMES_CAP) { windows_names = false; } -- 2.20.1