aboutsummaryrefslogtreecommitdiffstats
path: root/main/event.c
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-13 00:55:09 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-13 00:55:09 +0000
commit4d009015b34d92c95d7edefb1e771bd2827cacf3 (patch)
treeb3e5abcf2cdf02621bdcbb670d254b6601005d18 /main/event.c
parentdb10138f36675ec9146d20cadb5f50d4415e7233 (diff)
Fix a small logic error in ast_event_iterator_next. The previous logic allowed for the iterator
to indicate there was more data than there really was, causing the iterator read beyond the end of the event structure. This led to invalid memory reads and potential crashes. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@103559 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/event.c')
-rw-r--r--main/event.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/event.c b/main/event.c
index 705063b82..0d139c51a 100644
--- a/main/event.c
+++ b/main/event.c
@@ -383,7 +383,7 @@ void ast_event_iterator_init(struct ast_event_iterator *iterator, const struct a
int ast_event_iterator_next(struct ast_event_iterator *iterator)
{
iterator->ie = (struct ast_event_ie *) ( ((char *) iterator->ie) + sizeof(*iterator->ie) + ntohs(iterator->ie->ie_payload_len));
- return ((iterator->event_len < (((char *) iterator->ie) - ((char *) iterator->event))) ? -1 : 0);
+ return ((iterator->event_len <= (((char *) iterator->ie) - ((char *) iterator->event))) ? -1 : 0);
}
enum ast_event_ie_type ast_event_iterator_get_ie_type(struct ast_event_iterator *iterator)