From: Volker Lendecke Date: Tue, 21 Apr 2020 06:02:35 +0000 (+0200) Subject: libsmb: Add a NULL check after talloc_strdup() X-Git-Tag: ldb-2.2.0~744 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2d6448a3df643d0bbcfe40726c13aa15a36bfd5e;p=thirdparty%2Fsamba.git libsmb: Add a NULL check after talloc_strdup() Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- diff --git a/source3/libsmb/cli_smb2_fnum.c b/source3/libsmb/cli_smb2_fnum.c index 4cae87853db..40146af30f9 100644 --- a/source3/libsmb/cli_smb2_fnum.c +++ b/source3/libsmb/cli_smb2_fnum.c @@ -1550,6 +1550,9 @@ NTSTATUS cli_smb2_qpathinfo_basic(struct cli_state *cli, end in a '\' */ if (namelen > 0 && name[namelen-1] == '\\') { char *modname = talloc_strdup(talloc_tos(), name); + if (modname == NULL) { + return NT_STATUS_NO_MEMORY; + } modname[namelen-1] = '\0'; name = modname; }