summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/srvstr.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/source3/smbd/srvstr.c b/source3/smbd/srvstr.c
index 68e61033ae..bae77d5d4b 100644
--- a/source3/smbd/srvstr.c
+++ b/source3/smbd/srvstr.c
@@ -23,24 +23,14 @@ extern int max_send;
/* Make sure we can't write a string past the end of the buffer */
-size_t srvstr_push_fn(const char *function, unsigned int line,
+size_t srvstr_push_fn(const char *function, unsigned int line,
const char *base_ptr, uint16 smb_flags2, void *dest,
const char *src, int dest_len, int flags)
{
- size_t buf_used = PTR_DIFF(dest, base_ptr);
- if (dest_len == -1) {
- if (((ptrdiff_t)dest < (ptrdiff_t)base_ptr) || (buf_used > (size_t)max_send)) {
-#if 0
- DEBUG(0, ("Pushing string of 'unlimited' length into non-SMB buffer!\n"));
-#endif
- return push_string_fn(function, line, base_ptr,
- smb_flags2, dest, src, -1,
- flags);
- }
- return push_string_fn(function, line, base_ptr, smb_flags2,
- dest, src, max_send - buf_used, flags);
+ if (dest_len < 0) {
+ return 0;
}
-
+
/* 'normal' push into size-specified buffer */
return push_string_fn(function, line, base_ptr, smb_flags2, dest, src,
dest_len, flags);