mirror of
https://github.com/samba-team/samba.git
synced 2025-03-10 12:58:35 +03:00
r25277: Belt-and-braces approach to Volker's fix for RPC-SAMBA3-GETUSERNAME.
If we promise dest is null terminated, ensure we do it even on fast path exits. Jeremy.
This commit is contained in:
parent
9a9c164366
commit
32626e2b97
@ -1403,15 +1403,18 @@ size_t pull_ucs2(const void *base_ptr, char *dest, const void *src, size_t dest_
|
||||
{
|
||||
size_t ret;
|
||||
|
||||
if (!src_len) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (dest_len == (size_t)-1) {
|
||||
/* No longer allow dest_len of -1. */
|
||||
smb_panic("pull_ucs2 - invalid dest_len of -1");
|
||||
}
|
||||
|
||||
if (!src_len) {
|
||||
if (dest && dest_len > 0) {
|
||||
dest[0] = '\0';
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (ucs2_align(base_ptr, src, flags)) {
|
||||
src = (const void *)((const char *)src + 1);
|
||||
if (src_len != (size_t)-1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user