Remove overmalloc_safe_strcpy - can be simple strlcpy.
authorJeremy Allison <jra@samba.org>
Tue, 3 May 2011 20:40:07 +0000 (13:40 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 4 May 2011 19:12:14 +0000 (12:12 -0700)
lib/util/string_wrappers.h
source3/nmbd/nmbd_become_lmb.c
source3/nmbd/nmbd_browsesync.c

index 79119348c59e61bbbe21b884c618a96389f2bc64..4a5f51d96bc057b225fc665f001e6a88bdf18423 100644 (file)
@@ -56,14 +56,6 @@ size_t __unsafe_string_function_usage_here_size_t__(void);
  * update a lot of code. To make this a little easier here are some
  * functions that provide the lengths with less pain */
 
-/* overmalloc_safe_strcpy: DEPRECATED!  Used when you know the
- * destination buffer is longer than maxlength, but you don't know how
- * long.  This is not a good situation, because we can't do the normal
- * sanity checks. Don't use in new code! */
-
-#define overmalloc_safe_strcpy(dest,src,maxlength) \
-       safe_strcpy_fn(dest,src,maxlength)
-
 #ifdef HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS
 
 /* if the compiler will optimize out function calls, then use this to tell if we are
index ffd92cf0d8ff8f8996f918d14a00e2c4809ac80c..58dd3eec9ecbb03c8edeeee567d097b4b4f84335 100644 (file)
@@ -554,7 +554,7 @@ in workgroup %s on subnet %s\n",
        userdata->copy_fn = NULL;
        userdata->free_fn = NULL;
        userdata->userdata_len = strlen(work->work_group)+1;
-       overmalloc_safe_strcpy(userdata->data, work->work_group, size - sizeof(*userdata) - 1);
+       strlcpy(userdata->data, work->work_group, size - sizeof(*userdata));
 
        /* Register the special browser group name. */
        register_name(subrec, MSBROWSE, 0x01, samba_nb_type|NB_GROUP,
index 3dc89b502615a8ae8ac629a881bf8cf2e4c3b6d5..4a6f9f2d47d694a1d63b8f6d7a56d1622d154567 100644 (file)
@@ -330,7 +330,7 @@ static void find_domain_master_name_query_success(struct subnet_record *subrec,
        userdata->copy_fn = NULL;
        userdata->free_fn = NULL;
        userdata->userdata_len = strlen(work->work_group)+1;
-       overmalloc_safe_strcpy(userdata->data, work->work_group, size - sizeof(*userdata) - 1);
+       strlcpy(userdata->data, work->work_group, size - sizeof(*userdata));
 
        node_status( subrec, &nmbname, answer_ip, 
                domain_master_node_status_success,