socks5_connect: Fix compiler warning from GCC9 with -D_FORTIFY_SOURCE=2
authorFabian Keil <fk@fabiankeil.de>
Sat, 5 Dec 2020 13:12:25 +0000 (14:12 +0100)
committerFabian Keil <fk@fabiankeil.de>
Mon, 7 Dec 2020 15:01:33 +0000 (16:01 +0100)
    gateway.c: In function 'socks5_connect':
    gateway.c:1249:4: warning: 'strncpy' specified bound 295 equals destination size [-Wstringop-truncation]
     1249 |    strncpy(cbuf + client_pos, target_host, sizeof(cbuf) - client_pos);
          |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The warning is harmless because 'target_host' is checked to
be at most 255 bytes long.

Reported by Lee.


No differences found