r19652: Trying to track down which caller tries to store a 0 length domain name
authorGünther Deschner <gd@samba.org>
Fri, 10 Nov 2006 13:46:19 +0000 (13:46 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:15:44 +0000 (12:15 -0500)
in the affinity cache (which happens all the time here).

Guenther
(This used to be commit 45d6d300767d5b99aff332bdfb0a8f464fd103e0)

source3/libsmb/namequery.c

index 44932066b9a5a23620a4078cbf46fa0353706831..555d88fdc83343d30bf422a26cb2c84fbd01a594 100644 (file)
@@ -59,6 +59,11 @@ BOOL saf_store( const char *domain, const char *servername )
                DEBUG(2,("saf_store: Refusing to store empty domain or servername!\n"));
                return False;
        }
+
+       if ( (strlen(domain) == 0) || (strlen(servername) == 0) ) {
+               DEBUG(0,("saf_store: refusing to store 0 length domain or servername!\n"));
+               return False;
+       }
        
        if ( !gencache_init() ) 
                return False;
@@ -111,7 +116,7 @@ char *saf_fetch( const char *domain )
        BOOL ret = False;
        char *key = NULL;
 
-       if ( !domain ) {
+       if ( !domain || strlen(domain) == 0) {
                DEBUG(2,("saf_fetch: Empty domain name!\n"));
                return NULL;
        }