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:
parent
765dc320f1
commit
8700f4d93c
|
@ -143,8 +143,8 @@ IRC_PASS( CLIENT *Client, REQUEST *Req )
|
||||||
if (type && strcmp(type, PROTOIRCPLUS) == 0) {
|
if (type && strcmp(type, PROTOIRCPLUS) == 0) {
|
||||||
/* The peer seems to be a server which supports the
|
/* The peer seems to be a server which supports the
|
||||||
* IRC+ protocol (see doc/Protocol.txt). */
|
* IRC+ protocol (see doc/Protocol.txt). */
|
||||||
serverver = ptr + 1;
|
serverver = ptr ? ptr + 1 : "?";
|
||||||
flags = strchr(serverver, ':');
|
flags = strchr(ptr ? serverver : impl, ':');
|
||||||
if (flags) {
|
if (flags) {
|
||||||
*flags = '\0';
|
*flags = '\0';
|
||||||
flags++;
|
flags++;
|
||||||
|
|
Loading…
Reference in New Issue