? __unsafe_string_function_usage_here_size_t__() \
: srvstr_push_fn(base_ptr, smb_flags2, dest, src, dest_len, flags))
+/* This allows the developer to choose to check the arguments to
+ strlcpy. if the compiler will optimize out function calls, then
+ use this to tell if we are have the correct size buffer (this works only
+ where sizeof() returns the size of the buffer, not the size of the
+ pointer), so stack and static variables only */
+
+#define checked_strlcpy(dest, src, size) \
+ (sizeof(dest) != (size) \
+ ? __unsafe_string_function_usage_here_size_t__() \
+ : strlcpy(dest, src, size))
+
#else
#define safe_strcpy safe_strcpy_fn
#define clistr_push clistr_push_fn
#define clistr_pull clistr_pull_fn
#define srvstr_push srvstr_push_fn
+#define checked_strlcpy strlcpy
#endif
memset(blob_out.data, '\0', 16);
- safe_strcpy(unix_name, global_myname(), sizeof(unix_name)-1);
+ checked_strlcpy(unix_name, global_myname(), sizeof(unix_name));
strlower_m(unix_name);
push_ascii_nstring(dos_name, unix_name);
safe_strcpy((char *)blob_out.data, dos_name, 16);