packet.c: i < 256 was always true and i would overflow to 0
Visualize that the 0-termination is intentional, because the array is later passed to strlen within _libssh2_packet_askv.
This commit is contained in:
parent
8f799f98d9
commit
dc199ed03a
@ -1161,9 +1161,10 @@ _libssh2_packet_burn(LIBSSH2_SESSION * session,
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (*state == libssh2_NB_state_idle) {
|
if (*state == libssh2_NB_state_idle) {
|
||||||
for(i = 1; i < 256; i++) {
|
for(i = 1; i < 255; i++) {
|
||||||
all_packets[i - 1] = i;
|
all_packets[i - 1] = i;
|
||||||
}
|
}
|
||||||
|
all_packets[254] = 0;
|
||||||
|
|
||||||
if (_libssh2_packet_askv(session, all_packets, &data, &data_len, 0,
|
if (_libssh2_packet_askv(session, all_packets, &data, &data_len, 0,
|
||||||
NULL, 0) == 0) {
|
NULL, 0) == 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user