[SCM] Samba Shared Repository - branch master updated

Ralph Böhme slow at samba.org
Thu Oct 19 14:43:02 UTC 2017


The branch, master has been updated
       via  42e7671 nwrap: Fix strotoul checks for NSS_WRAPPER_MAX_HOSTENTS
      from  5dc773a python: use communicate to fix Popen deadlock

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


- Log -----------------------------------------------------------------
commit 42e7671226fe410ef06edb3a35906bc451e2fa44
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Thu Oct 19 10:56:15 2017 +0200

    nwrap: Fix strotoul checks for NSS_WRAPPER_MAX_HOSTENTS
    
    The env and endptr pointers need to be dereferenced, but that is not
    enough: we don't really want to regard an empty string (*env == '\0')
    as a valid number.
    
    Found by GCC 8.0.0 20170705 (experimental).
    
    [2095/4103] Compiling lib/nss_wrapper/nss_wrapper.c
    ../lib/nss_wrapper/nss_wrapper.c: In function "nwrap_init":
    ../lib/nss_wrapper/nss_wrapper.c:1571:13: warning: comparison between pointer and zero character constant [-Wpointer-compare]
       if (((env != '\0') && (endptr == '\0')) ||
                    ^~
                    ../lib/nss_wrapper/nss_wrapper.c:1571:9: note: did you mean to dereference the pointer?
       if (((env != '\0') && (endptr == '\0')) ||
                ^
                ../lib/nss_wrapper/nss_wrapper.c:1571:33: warning: comparison between pointer and zero character constant [-Wpointer-compare]
       if (((env != '\0') && (endptr == '\0')) ||
                                        ^~
                                        ../lib/nss_wrapper/nss_wrapper.c:1571:26: note: did you mean to dereference the pointer?
       if (((env != '\0') && (endptr == '\0')) ||
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(master): Ralph Böhme <slow at samba.org>
    Autobuild-Date(master): Thu Oct 19 16:42:17 CEST 2017 on sn-devel-144

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

Summary of changes:
 lib/nss_wrapper/nss_wrapper.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/nss_wrapper/nss_wrapper.c b/lib/nss_wrapper/nss_wrapper.c
index 82581b1..566d02c 100644
--- a/lib/nss_wrapper/nss_wrapper.c
+++ b/lib/nss_wrapper/nss_wrapper.c
@@ -1567,8 +1567,9 @@ static void nwrap_init(void)
 
 	env = getenv("NSS_WRAPPER_MAX_HOSTENTS");
 	if (env != NULL) {
-		max_hostents_tmp = (size_t)strtol(env, &endptr, 10);
-		if (((env != '\0') && (endptr == '\0')) ||
+		max_hostents_tmp = (size_t)strtoul(env, &endptr, 10);
+		if ((*env == '\0') ||
+		    (*endptr != '\0') ||
 		    (max_hostents_tmp == 0)) {
 			NWRAP_LOG(NWRAP_LOG_DEBUG,
 				  "Error parsing NSS_WRAPPER_MAX_HOSTENTS "


-- 
Samba Shared Repository



More information about the samba-cvs mailing list