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:
Marc Hoersken 2014-12-26 11:21:10 +01:00
parent 8f799f98d9
commit dc199ed03a

View File

@ -1161,9 +1161,10 @@ _libssh2_packet_burn(LIBSSH2_SESSION * session,
int ret;
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[254] = 0;
if (_libssh2_packet_askv(session, all_packets, &data, &data_len, 0,
NULL, 0) == 0) {