mirror of
https://github.com/samba-team/samba.git
synced 2025-01-25 06:04:04 +03:00
CVE-2018-10858: libsmb: Ensure smbc_urlencode() can't overwrite passed in buffer.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13453 CVE-2018-10858: Insufficient input validation on client directory listing in libsmbclient. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
parent
30428f36f7
commit
6936d3e2f2
@ -173,8 +173,13 @@ smbc_urlencode(char *dest,
|
||||
}
|
||||
}
|
||||
|
||||
*dest++ = '\0';
|
||||
max_dest_len--;
|
||||
if (max_dest_len == 0) {
|
||||
/* Ensure we return -1 if no null termination. */
|
||||
return -1;
|
||||
}
|
||||
|
||||
*dest++ = '\0';
|
||||
max_dest_len--;
|
||||
|
||||
return max_dest_len;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user