Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Avoid null pointer dereference in chdir_homedir()

Return if pw is NULL, to avoid dereferencing it at pw->pw_dir.
  • Loading branch information...
commit f0d9cb3db3b419f84893a6efb6bf136ed2b4d120 1 parent 815aff9
@xiw xiw authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  src/frontend/mosh-server.cc
View
2  src/frontend/mosh-server.cc
@@ -747,7 +747,7 @@ void chdir_homedir( void )
struct passwd *pw = getpwuid( geteuid() );
if ( pw == NULL ) {
perror( "getpwuid" );
- /* non-fatal */
+ return; /* non-fatal */
}
if ( chdir( pw->pw_dir ) < 0 ) {
Please sign in to comment.
Something went wrong with that request. Please try again.