projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
466bec2
)
fix buffer overrun by 1
author
Wilfried Goesgens
<dothebart@citadel.org>
Thu, 6 Jun 2013 19:02:28 +0000
(21:02 +0200)
committer
Wilfried Goesgens
<dothebart@citadel.org>
Thu, 6 Jun 2013 19:02:28 +0000
(21:02 +0200)
citadel/msgbase.c
patch
|
blob
|
history
diff --git
a/citadel/msgbase.c
b/citadel/msgbase.c
index 5c10578c0160e711ab4464789833815bcda8bf91..682f993a214feb17f1f86ae0c91b48894500d2fd 100644
(file)
--- a/
citadel/msgbase.c
+++ b/
citadel/msgbase.c
@@
-4855,6
+4855,10
@@
int CtdlDeleteMessages(char *room_name, /* which room */
}
else {
while ((i < num_msgs) && (msglist[i] < dmsgnums[j])) i++;
}
else {
while ((i < num_msgs) && (msglist[i] < dmsgnums[j])) i++;
+
+ if (i >= num_msgs)
+ continue;
+
if (msglist[i] == dmsgnums[j]) {
delete_this |= 0x01;
}
if (msglist[i] == dmsgnums[j]) {
delete_this |= 0x01;
}