From 3a7d7fa8668ebc5434df06ec2593af1263e931e4 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 8 Jan 2013 18:54:20 +0100 Subject: [PATCH] Really fix accepting connections from "long" IPv6 address Commit ee01ac19 (v4.3.23) enlarged player member hostaddr from 32 to 46 characters, but missed natstr member nat_hostaddr. player_main() copies hostaddr to nat_hostaddr. Can overrun the destination, but fortunately just into nat_hostname. Impact: * Can makes praddr() print only a suffix of the address. Used by play command, for player messages during login and logout, and for logging. * Can make player_main()'s test for "same address as last time" fail, causing extra "Last connection" messages. * Matching against econfig key privip is not affected. * Journal event login is not affected. --- include/nat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/nat.h b/include/nat.h index 74c7ed665..fd01289e7 100644 --- a/include/nat.h +++ b/include/nat.h @@ -93,7 +93,7 @@ struct natstr { enum nat_status nat_stat; char nat_cnam[20]; /* country name */ char nat_pnam[20]; /* representative */ - char nat_hostaddr[32]; /* host addr of last user */ + char nat_hostaddr[46]; /* host addr of last user */ char nat_hostname[512]; /* hostname of last user, may be empty */ char nat_userid[32]; /* userid of last user, may be empty */ coord nat_xcap, nat_ycap; /* cap location in abs coords */ -- 2.43.0