Skip to content

Commit 67f2782

Browse files
committed
Fix GCC -Wstringop-truncation
1 parent 1a9b6c4 commit 67f2782

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

storage/spider/spd_conn.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4544,6 +4544,7 @@ SPIDER_IP_PORT_CONN* spider_create_ipport_conn(SPIDER_CONN *conn)
45444544
memcpy(ret->key, conn->conn_key, ret->key_len);
45454545

45464546
strncpy(ret->remote_ip_str, conn->tgt_host, sizeof(ret->remote_ip_str));
4547+
ret->remote_ip_str[sizeof ret->remote_ip_str - 1] = '\0';
45474548
ret->remote_port = conn->tgt_port;
45484549
ret->conn_id = conn->conn_id;
45494550
ret->ip_port_count = 1; // init

0 commit comments

Comments
 (0)