dfs_server: Fix debug statement if searched_site is NULL
authorAndreas Schneider <asn@samba.org>
Thu, 20 Apr 2023 11:09:26 +0000 (13:09 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 27 Apr 2023 07:21:33 +0000 (07:21 +0000)
In file included from source4/include/includes.h:61,
                 from dfs_server/dfs_server_ad.c:21:
dfs_server/dfs_server_ad.c: In function ‘get_dcs.constprop’:
lib/util/debug.h:200:12: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  200 |        && (dbgtext body) )
      |           ~^~~~~~~~~~~~~
dfs_server/dfs_server_ad.c:462:25: note: in expansion of macro ‘DEBUG’
  462 |                         DEBUG(2,(__location__ ": Site: %s %s\n",
      |                         ^~~~~

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
dfs_server/dfs_server_ad.c

index b97d0882f94d55bcaefe4a36457f5b44de2ea90f..f992042966e9743d55c26c0219d549569ebc04a0 100644 (file)
@@ -459,8 +459,11 @@ static NTSTATUS get_dcs(TALLOC_CTX *ctx, struct ldb_context *ldb,
 
                if (searched_site == NULL ||
                    strcmp(searched_site, site_name) != 0) {
-                       DEBUG(2,(__location__ ": Site: %s %s\n",
-                               searched_site, site_name));
+                       DEBUG(2,
+                             (__location__ ": Site: %s %s\n",
+                              searched_site != NULL ? searched_site
+                                                    : "UNKNOWN",
+                              site_name));
 
                        /*
                         * Do all the site but the one of the client