mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
ba60f64752
By decrementing 'pad' only when we know it's safe, we ensure we can't stray backwards past the start of a buffer, which would be undefined behaviour. In the previous version of the loop, 'i' is the number of bytes left to check, and 'pad' is the current byte we're checking. 'pad' was decremented at the end of each loop iteration. If 'i' was 1 (so we checked the final byte), 'pad' could potentially be pointing to the first byte of the input buffer, and the decrement would put it one byte behind the buffer. That would be undefined behaviour. The patch changes it so that 'pad' is the byte we previously checked, which allows us to ensure that we only decrement it when we know we have a byte to check. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15134 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> |
||
---|---|---|
.. | ||
aesni-intel | ||
cmocka | ||
gpfs | ||
heimdal | ||
heimdal_build | ||
nss_wrapper | ||
pam_wrapper | ||
popt | ||
resolv_wrapper | ||
socket_wrapper | ||
uid_wrapper | ||
waf | ||
update.sh | ||
wscript |