fix buffer overrun by 1
authorWilfried Goesgens <dothebart@citadel.org>
Thu, 6 Jun 2013 19:02:28 +0000 (21:02 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Thu, 6 Jun 2013 19:02:28 +0000 (21:02 +0200)
citadel/msgbase.c

index 5c10578c0160e711ab4464789833815bcda8bf91..682f993a214feb17f1f86ae0c91b48894500d2fd 100644 (file)
@@ -4855,6 +4855,10 @@ int CtdlDeleteMessages(char *room_name,          /* which room */
                        }
                        else {
                                while ((i < num_msgs) && (msglist[i] < dmsgnums[j])) i++;
+
+                               if (i >= num_msgs)
+                                       continue;
+
                                if (msglist[i] == dmsgnums[j]) {
                                        delete_this |= 0x01;
                                }