diff --git a/svr-chansession.c b/svr-chansession.c index da3fe8d..7cedb8e 100644 --- a/svr-chansession.c +++ b/svr-chansession.c @@ -799,10 +799,10 @@ static int ptycommand(struct Channel *channel, struct ChanSess *chansess) { /* don't show the motd if ~/.hushlogin exists */ /* 12 == strlen("/.hushlogin\0") */ - len = strlen(ses.authstate.pw->pw_dir) + 12; + len = strlen(ses.authstate.pw_dir) + 12; hushpath = m_malloc(len); - snprintf(hushpath, len, "%s/.hushlogin", ses.authstate.pw->pw_dir); + snprintf(hushpath, len, "%s/.hushlogin", ses.authstate.pw_dir); if (stat(hushpath, &sb) < 0) { /* more than a screenful is stupid IMHO */