diff options
author | Volker Lendecke <vlendec@samba.org> | 2007-07-05 16:33:37 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:23:49 -0500 |
commit | 836782b07bf133e9b2598c4a089f1c810e4c7754 (patch) | |
tree | 409156436e3ecf8c3009af498551ce7e45b2bfa3 /source/lib/charcnv.c | |
parent | a50555dda7db5e848e337185ed91c41c2557f7be (diff) | |
download | samba-836782b07bf133e9b2598c4a089f1c810e4c7754.tar.gz samba-836782b07bf133e9b2598c4a089f1c810e4c7754.tar.xz samba-836782b07bf133e9b2598c4a089f1c810e4c7754.zip |
r23726: Explicitly pass down the FLAGS2 field to srvstr_pull_buf. The next
checkin will pull this up to srvstr_get_path. At that point we can get more
independent of the inbuf, the base_ptr in pull_string will only be used
to satisfy UCS2 alignment constraints.
Diffstat (limited to 'source/lib/charcnv.c')
-rw-r--r-- | source/lib/charcnv.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source/lib/charcnv.c b/source/lib/charcnv.c index 35343b2f0a2..5ca7f201c24 100644 --- a/source/lib/charcnv.c +++ b/source/lib/charcnv.c @@ -1376,16 +1376,24 @@ size_t push_string_fn(const char *function, unsigned int line, const void *base_ The resulting string in "dest" is always null terminated. **/ -size_t pull_string_fn(const char *function, unsigned int line, const void *base_ptr, char *dest, const void *src, size_t dest_len, size_t src_len, int flags) +size_t pull_string_fn(const char *function, unsigned int line, + const void *base_ptr, uint16 smb_flags2, char *dest, + const void *src, size_t dest_len, size_t src_len, + int flags) { #ifdef DEVELOPER if (dest_len != (size_t)-1) clobber_region(function, line, dest, dest_len); #endif + if ((base_ptr == NULL) && ((flags & (STR_ASCII|STR_UNICODE)) == 0)) { + smb_panic("No base ptr to get flg2 and neither ASCII nor " + "UNICODE defined"); + } + if (!(flags & STR_ASCII) && \ ((flags & STR_UNICODE || \ - (SVAL(base_ptr, smb_flg2) & FLAGS2_UNICODE_STRINGS)))) { + (smb_flags2 & FLAGS2_UNICODE_STRINGS)))) { return pull_ucs2(base_ptr, dest, src, dest_len, src_len, flags); } return pull_ascii(dest, src, dest_len, src_len, flags); |