]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: libsmb: Add missing memory allocation fail checks in cli_ntcreate1_send().
authorJeremy Allison <jra@samba.org>
Wed, 7 Sep 2022 18:12:08 +0000 (11:12 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 15 Sep 2022 18:43:32 +0000 (18:43 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
source3/libsmb/clifile.c

index 4cc9f231c37eed0576f8ba58dd0d07519eb55991..86a6b58a6eddb836d0b4cfd16c3ed5a74ee4bf2c 100644 (file)
@@ -2505,9 +2505,15 @@ static struct tevent_req *cli_ntcreate1_send(TALLOC_CTX *mem_ctx,
        SCVAL(vwv+23, 1, SecurityFlags);
 
        bytes = talloc_array(state, uint8_t, 0);
+       if (tevent_req_nomem(bytes, req)) {
+               return tevent_req_post(req, ev);
+       }
        bytes = smb_bytes_push_str(bytes, smbXcli_conn_use_unicode(cli->conn),
                                   fname, strlen(fname)+1,
                                   &converted_len);
+       if (tevent_req_nomem(bytes, req)) {
+               return tevent_req_post(req, ev);
+       }
 
        if (clistr_is_previous_version_path(fname, NULL, NULL, NULL)) {
                additional_flags2 = FLAGS2_REPARSE_PATH;