@@ -441,13 +441,14 @@ static int event_loop(Context *context)
441441 if (client_buf -> pos < (len_with_header = 2 + TAG_LEN + (size_t ) len )) {
442442 break ;
443443 }
444- if (len > sizeof client_buf -> data || uc_decrypt (context -> uc_st [1 ], client_buf -> data ,
445- len , client_buf -> tag , TAG_LEN ) != 0 ) {
444+ if ((size_t ) len > sizeof client_buf -> data ||
445+ uc_decrypt (context -> uc_st [1 ], client_buf -> data , (size_t ) len , client_buf -> tag ,
446+ TAG_LEN ) != 0 ) {
446447 fprintf (stderr , "Corrupted stream\n" );
447448 sleep (1 );
448449 return client_reconnect (context );
449450 }
450- if (tun_write (context -> tun_fd , client_buf -> data , len ) != len ) {
451+ if (tun_write (context -> tun_fd , client_buf -> data , ( size_t ) len ) != len ) {
451452 perror ("tun_write" );
452453 }
453454 if (2 + TAG_LEN + MAX_PACKET_LEN != len_with_header ) {
@@ -512,7 +513,7 @@ __attribute__((noreturn)) static void usage(void)
512513 "\n"
513514 "dsvpn\t\"server\"\n\t<key file>\n\t<vpn server ip or name>|\"auto\"\n\t<vpn "
514515 "server port>|\"auto\"\n\t<tun interface>|\"auto\"\n\t<local tun "
515- "ip>|\"auto\"\n\t<remote tun ip>\"auto\"\n\t<external ip>|\"auto\""
516+ "ip>|\"auto\"\n\t<remote tun ip>| \"auto\"\n\t<external ip>|\"auto\""
516517 "\n\n"
517518 "dsvpn\t\"client\"\n\t<key file>\n\t<vpn server ip or name>\n\t<vpn server "
518519 "port>|\"auto\"\n\t<tun interface>|\"auto\"\n\t<local tun "
0 commit comments