dfs_server: Use multi-byte string handling
authorRobin McCorkell <rmccorkell@karoshi.org.uk>
Thu, 9 Jul 2015 20:20:13 +0000 (21:20 +0100)
committerVolker Lendecke <vl@samba.org>
Fri, 10 Jul 2015 18:35:47 +0000 (20:35 +0200)
Pre-empt a bug with multi-byte DFS pathname handling by using strchr_m()

Signed-off-by: Robin McCorkell <rmccorkell@karoshi.org.uk>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Jul 10 20:35:47 CEST 2015 on sn-devel-104

dfs_server/dfs_server_ad.c

index cacad0b..3a25dff 100644 (file)
@@ -833,12 +833,12 @@ NTSTATUS dfs_server_ad_get_referrals(struct loadparm_context *lp_ctx,
                server_name++;
        }
 
-       dfs_name = strchr(server_name, path_separator);
+       dfs_name = strchr_m(server_name, path_separator);
        if (dfs_name != NULL) {
                dfs_name[0] = '\0';
                dfs_name++;
 
-               link_path = strchr(dfs_name, path_separator);
+               link_path = strchr_m(dfs_name, path_separator);
                if (link_path != NULL) {
                        link_path[0] = '\0';
                        link_path++;