diff options
author | Jeremy Allison <jra@samba.org> | 2007-11-16 13:14:24 -0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2007-11-16 13:14:24 -0800 |
commit | 6ff701e695e847414afb0320a6701fe252d3f311 (patch) | |
tree | 718fd4b1b638402b436b12f26e3bb6259c69f620 /source3 | |
parent | acb829ecc3b9af3f141425ecac032a7c722a1815 (diff) | |
download | samba-6ff701e695e847414afb0320a6701fe252d3f311.tar.gz samba-6ff701e695e847414afb0320a6701fe252d3f311.tar.bz2 samba-6ff701e695e847414afb0320a6701fe252d3f311.zip |
Match the 3.0.27a version of this function.
Jeremy.
(This used to be commit 629406cbe77a5d56a258ac414ab47f3e89183e52)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/smbd/srvstr.c | 18 |
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); |