mirror of
https://github.com/libssh2/libssh2.git
synced 2026-01-27 00:18:12 +03:00
transport.c : fixes bounds check if partial packet is read
Files : transport.c Issue : #360 Notes : 'p->total_num' instead of local value total_num when doing bounds check. Credit : Doublex
This commit is contained in:
@@ -565,7 +565,7 @@ int _libssh2_transport_read(LIBSSH2_SESSION * session)
|
||||
copy them as-is to the target buffer */
|
||||
if(numbytes > 0) {
|
||||
|
||||
if(numbytes <= (int)(total_num - (p->wptr - p->payload))) {
|
||||
if(numbytes <= (int)(p->total_num - (p->wptr - p->payload))) {
|
||||
memcpy(p->wptr, &p->buf[p->readidx], numbytes);
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user