]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libsmb: Add a NULL check after talloc_strdup()
authorVolker Lendecke <vl@samba.org>
Tue, 21 Apr 2020 06:02:35 +0000 (08:02 +0200)
committerRalph Boehme <slow@samba.org>
Tue, 5 May 2020 11:48:39 +0000 (11:48 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/libsmb/cli_smb2_fnum.c

index 4cae87853db23dbf9cd5ac25dbeb8f1e3c394d40..40146af30f9ccbaac554371f5e479dbb6ca8c579 100644 (file)
@@ -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;
        }