Fix player_login() not to print null pointer
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 16 Jan 2010 15:29:41 +0000 (16:29 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 19 Jan 2010 07:40:42 +0000 (08:40 +0100)
commit6c8ba9c3fd4432318984a9e2f873b66dd8dc5166
tree4ba70849bfae25d069bab1ef06fe7b72354e89a3
parent8195d5fb8874ee2c5f5bfe53077a511230ea79eb
Fix player_login() not to print null pointer

When the input line contains only whitespace, player->argp[0] is null
after parse().  This condition was not checked, comtch() returned
M_IGNORE, and code handling that printed the null pointer.  Some
systems (GNU, Windows) deal gracefully with printing null strings,
others crash.  Trivial to trigger remotely.

Before the fix, the value of parse() was assigned, but never used, and
that was spotted by the Clang Static Analyzer.
src/lib/player/login.c