summaryrefslogtreecommitdiffstats
path: root/lib/util/string_wrappers.h
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2014-08-25 17:11:58 -0700
committerDavid Disseldorp <ddiss@samba.org>2014-09-16 01:56:54 +0200
commit0519088c53b201b7ca1f144f3f2da052c612c0e7 (patch)
tree59d41b8d7869877d0c8579fb2663817a618f9f84 /lib/util/string_wrappers.h
parentc7b89bb9e5531be378c1b71fa7165f3ce74c83bb (diff)
downloadsamba-0519088c53b201b7ca1f144f3f2da052c612c0e7.tar.gz
samba-0519088c53b201b7ca1f144f3f2da052c612c0e7.tar.xz
samba-0519088c53b201b7ca1f144f3f2da052c612c0e7.zip
s3: smbd: Change the function signature of srvstr_push() from returning a length to returning an NTSTATUS with a length param.
srvstr_push_fn() now returns an NTSTATUS reporting any string conversion failure. We need to get serious about returning character set conversion errors inside smbd. Bug 10775 - smbd crashes when accessing garbage filenames https://bugzilla.samba.org/show_bug.cgi?id=10775 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
Diffstat (limited to 'lib/util/string_wrappers.h')
-rw-r--r--lib/util/string_wrappers.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/util/string_wrappers.h b/lib/util/string_wrappers.h
index fcc088ca04..1feea8cbc0 100644
--- a/lib/util/string_wrappers.h
+++ b/lib/util/string_wrappers.h
@@ -57,6 +57,8 @@ char * __unsafe_string_function_usage_here__(void);
size_t __unsafe_string_function_usage_here_size_t__(void);
+NTSTATUS __unsafe_string_function_usage_here_NTSTATUS__(void);
+
#define CHECK_STRING_SIZE(d, len) (sizeof(d) != (len) && sizeof(d) != sizeof(char *))
/* if the compiler will optimize out function calls, then use this to tell if we are
@@ -68,10 +70,10 @@ size_t __unsafe_string_function_usage_here_size_t__(void);
? __unsafe_string_function_usage_here_size_t__() \
: push_string_check_fn(dest, src, dest_len, flags))
-#define srvstr_push(base_ptr, smb_flags2, dest, src, dest_len, flags) \
+#define srvstr_push(base_ptr, smb_flags2, dest, src, dest_len, flags, ret_len) \
(CHECK_STRING_SIZE(dest, dest_len) \
- ? __unsafe_string_function_usage_here_size_t__() \
- : srvstr_push_fn(base_ptr, smb_flags2, dest, src, dest_len, flags))
+ ? __unsafe_string_function_usage_here_NTSTATUS__() \
+ : srvstr_push_fn(base_ptr, smb_flags2, dest, src, dest_len, flags, ret_len))
/* This allows the developer to choose to check the arguments to
strlcpy. if the compiler will optimize out function calls, then