The branch, master has been updated
       via  86a31defbf2 ndr basic: Check ndr_token_store return code
      from  60b72f589e2 vfs_ceph: assert renameat() fsps match cwd

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 86a31defbf212d188281d5d963b12eedf1960e8b
Author: Gary Lockyer <[email protected]>
Date:   Wed Jan 8 09:39:30 2020 +1300

    ndr basic: Check ndr_token_store return code
    
    Fix for
    
    *** CID 1457529:  Error handling issues  (CHECKED_RETURN)
    /librpc/ndr/ndr_basic.c: 786 in ndr_push_full_ptr()
    ...
    ID 1457529:  Error handling issues  (CHECKED_RETURN)
        Calling "ndr_token_store" without checking return value (as is done
        elsewhere 14 out of 17 times).
    
    Signed-off-by: Gary Lockyer <[email protected]>
    Reviewed-by: David Disseldorp <[email protected]>
    
    Autobuild-User(master): Gary Lockyer <[email protected]>
    Autobuild-Date(master): Thu Jan  9 21:49:00 UTC 2020 on sn-devel-184

-----------------------------------------------------------------------

Summary of changes:
 librpc/ndr/ndr_basic.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/librpc/ndr/ndr_basic.c b/librpc/ndr/ndr_basic.c
index 5c717e69858..0811a590971 100644
--- a/librpc/ndr/ndr_basic.c
+++ b/librpc/ndr/ndr_basic.c
@@ -781,9 +781,13 @@ _PUBLIC_ enum ndr_err_code ndr_push_full_ptr(struct 
ndr_push *ndr, const void *p
                /* Check if the pointer already exists and has an id */
                ptr = ndr_token_peek(&ndr->full_ptr_list, p);
                if (ptr == 0) {
+                       enum ndr_err_code ret = NDR_ERR_SUCCESS;
                        ndr->ptr_count++;
                        ptr = ndr->ptr_count;
-                       ndr_token_store(ndr, &ndr->full_ptr_list, p, ptr);
+                       ret = ndr_token_store(ndr, &ndr->full_ptr_list, p, ptr);
+                       if (ret != NDR_ERR_SUCCESS) {
+                               return ret;
+                       }
                }
        }
        return ndr_push_uint3264(ndr, NDR_SCALARS, ptr);


-- 
Samba Shared Repository

Reply via email to