The branch, master has been updated
       via  86420d9 nwrap_files_getaddrinfo: avoid crash on empty name
      from  b20ae47 Bump version 1.1.11

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


- Log -----------------------------------------------------------------
commit 86420d91ddc22d71ffeed4dcbc02bef0f6042cbe
Author: Douglas Bagnall <douglas.bagn...@catalyst.net.nz>
Date:   Sun May 17 13:14:08 2020 +1200

    nwrap_files_getaddrinfo: avoid crash on empty name
    
    When name is "", we would deref name[-1]. If by chance name[-1] was
    '.', we also tried to copy all of memory from one place to another.
    
    Rather than just guard the immediate next branch, let's assume the
    empty name is never found.
    
    Signed-off-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz>
    Reviewed-by: Andreas Schneider <a...@samba.org>

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

Summary of changes:
 src/nss_wrapper.c | 4 ++++
 1 file changed, 4 insertions(+)


Changeset truncated at 500 lines:

diff --git a/src/nss_wrapper.c b/src/nss_wrapper.c
index 17c8732..4f4dc93 100644
--- a/src/nss_wrapper.c
+++ b/src/nss_wrapper.c
@@ -4070,6 +4070,10 @@ static int nwrap_files_getaddrinfo(const char *name,
        }
 
        name_len = strlen(name);
+       if (name_len == 0) {
+               return EAI_NONAME;
+       }
+
        if (name_len < sizeof(canon_name) && name[name_len - 1] == '.') {
                memcpy(canon_name, name, name_len - 1);
                canon_name[name_len] = '\0';


-- 
NSS Wrapper Repository

Reply via email to