Created attachment 1656 [details] patch solving the problem on some obscure instalation the $HOME is enormly long.
Are you sure that's all that's needed? That buf gets used with: snprintf(buf, sizeof buf, "%.100s/%.100s", pw->pw_dir, _PATH_SSH_USER_CONFFILE); which will also truncate.
Created attachment 1657 [details] the patch version 2 You are right. The patch#2 solves the whole problem.
We ended up with something similar but with some extra checks for snprintf return values: http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/ssh.c.diff?r1=text&tr1=1.325&r2=text&tr2=1.326 Thanks, this will be in the next release.
Mass move of RESOLVED bugs to CLOSED now that 5.3 is out.