1
1
Этот коммит содержится в:
Daniel Stenberg 2006-11-19 13:26:19 +00:00
родитель 1854b4536f
Коммит ab26693769

Просмотреть файл

@ -257,7 +257,11 @@ LIBSSH2_API LIBSSH2_CHANNEL *libssh2_channel_direct_tcpip_ex(LIBSSH2_SESSION *se
memcpy(s, shost, shost_len); s += shost_len; memcpy(s, shost, shost_len); s += shost_len;
libssh2_htonu32(s, sport); s += 4; libssh2_htonu32(s, sport); s += 4;
channel = libssh2_channel_open_ex(session, "direct-tcpip", sizeof("direct-tcpip") - 1, LIBSSH2_CHANNEL_WINDOW_DEFAULT, LIBSSH2_CHANNEL_PACKET_DEFAULT, message, message_len); channel = libssh2_channel_open_ex(session, "direct-tcpip",
sizeof("direct-tcpip") - 1,
LIBSSH2_CHANNEL_WINDOW_DEFAULT,
LIBSSH2_CHANNEL_PACKET_DEFAULT,
(char *)message, message_len);
LIBSSH2_FREE(session, message); LIBSSH2_FREE(session, message);
return channel; return channel;
@ -631,11 +635,11 @@ LIBSSH2_API int libssh2_channel_x11_req_ex(LIBSSH2_CHANNEL *channel, int single_
memcpy(s, auth_cookie, cookie_len); memcpy(s, auth_cookie, cookie_len);
} else { } else {
int i; int i;
char buffer[LIBSSH2_X11_RANDOM_COOKIE_LEN / 2]; unsigned char buffer[LIBSSH2_X11_RANDOM_COOKIE_LEN / 2];
RAND_bytes(buffer, LIBSSH2_X11_RANDOM_COOKIE_LEN / 2); RAND_bytes(buffer, LIBSSH2_X11_RANDOM_COOKIE_LEN / 2);
for (i = 0; i < (LIBSSH2_X11_RANDOM_COOKIE_LEN / 2); i++) { for (i = 0; i < (LIBSSH2_X11_RANDOM_COOKIE_LEN / 2); i++) {
snprintf(s + (i * 2), 2, "%02X", buffer[i]); snprintf((char *)s + (i * 2), 2, "%02X", buffer[i]);
} }
} }
s += cookie_len; s += cookie_len;