Better check for invalid IRC+ PASS command

Don't do a NULL-pointer dereference when a remote server using the
IRC+ protocol sends an invalid PASS command without the required
<serverversion> parameter ...
This commit is contained in:
Alexander Barton 2011-01-23 18:38:36 +01:00
parent 765dc320f1
commit 8700f4d93c
1 changed files with 2 additions and 2 deletions

View File

@ -143,8 +143,8 @@ IRC_PASS( CLIENT *Client, REQUEST *Req )
if (type && strcmp(type, PROTOIRCPLUS) == 0) {
/* The peer seems to be a server which supports the
* IRC+ protocol (see doc/Protocol.txt). */
serverver = ptr + 1;
flags = strchr(serverver, ':');
serverver = ptr ? ptr + 1 : "?";
flags = strchr(ptr ? serverver : impl, ':');
if (flags) {
*flags = '\0';
flags++;