fixed WHOHandler.c
authorpk910 <philipp@zoelle1.de>
Mon, 10 Oct 2011 19:56:05 +0000 (21:56 +0200)
committerpk910 <philipp@zoelle1.de>
Mon, 17 Oct 2011 14:06:47 +0000 (16:06 +0200)
src/WHOHandler.c

index 3ebe0bd186eee6306ae77080d72021e216854735..a296298933395d51e11843fb376b478663067484 100644 (file)
@@ -131,6 +131,7 @@ void recv_whohandler_354(struct ClientSocket *client, char **argv, unsigned int
     int i;
     if(argc < 2) return;
     int type = atoi(argv[1]);
+    if(!type) return;
     if(!(type & WHOQUEUETYPE_ISONQUEUE)) return;
     struct WHOQueueEntry* entry = getNextWHOQueueEntry(client, 0);
     if(entry == NULL || (entry->type & WHOQUEUETYPE_CHECKTYPE) != (type & WHOQUEUETYPE_CHECKTYPE)) return;
@@ -202,6 +203,7 @@ void recv_whohandler_354(struct ClientSocket *client, char **argv, unsigned int
 void recv_whohandler_315(struct ClientSocket *client, char **argv, unsigned int argc) {
     if(argc < 2) return;
     char *typestr = strstr(argv[1], ",") + 1;
+    if(!typestr) return;
     int type = atoi(typestr);
     if(!(type & WHOQUEUETYPE_ISONQUEUE)) return;
     struct WHOQueueEntry* entry = getNextWHOQueueEntry(client, 1);