diff --git a/client.c b/client.c index 9b476f0..2d53b56 100644 --- a/client.c +++ b/client.c @@ -295,8 +295,8 @@ void selectTunnel(SSL* ssl, int sockfd, int tunfd) { //获取服务端分配的虚拟IP int recvVirtualIP(SSL* ssl) { - char buf[10]; - SSL_read(ssl,buf,BUFF_SIZE); + char buf[10] = {0}; + SSL_read(ssl,buf,9); int virtualIP = atoi(buf); printf("virtualIP: 192.168.53.%d/24\n",virtualIP); return virtualIP; @@ -350,4 +350,4 @@ int main(int argc, char *argv[]) { SSL_free(ssl); close(sockfd); return 0; -} \ No newline at end of file +}