summaryrefslogtreecommitdiffstats
path: root/contrib/sendmail/libmilter/engine.c
diff options
context:
space:
mode:
authorgshapiro <gshapiro@FreeBSD.org>2006-06-14 16:23:02 +0000
committergshapiro <gshapiro@FreeBSD.org>2006-06-14 16:23:02 +0000
commit519bd6b141ceebfd6ecf5d83fc6982ba2400d1f6 (patch)
treecc2608de04a102294610c8979b33e4638632f673 /contrib/sendmail/libmilter/engine.c
parentb692e05a4491e02dd89c68fae75d1bff801b74ee (diff)
parent1024e3943e17bd4407f0cf3a799cfa05d59f1059 (diff)
downloadFreeBSD-src-519bd6b141ceebfd6ecf5d83fc6982ba2400d1f6.zip
FreeBSD-src-519bd6b141ceebfd6ecf5d83fc6982ba2400d1f6.tar.gz
This commit was generated by cvs2svn to compensate for changes in r159609,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'contrib/sendmail/libmilter/engine.c')
-rw-r--r--contrib/sendmail/libmilter/engine.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/contrib/sendmail/libmilter/engine.c b/contrib/sendmail/libmilter/engine.c
index eeeb2c5..8b4bed0 100644
--- a/contrib/sendmail/libmilter/engine.c
+++ b/contrib/sendmail/libmilter/engine.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999-2003 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 1999-2004, 2006 Sendmail, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
@@ -9,7 +9,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Id: engine.c,v 8.120 2004/10/20 21:09:00 ca Exp $")
+SM_RCSID("@(#)$Id: engine.c,v 8.121 2006/04/18 21:01:46 ca Exp $")
#include "libmilter.h"
@@ -166,6 +166,8 @@ static int next_states[] =
NX_UNKN
};
+#define SIZE_NEXT_STATES (sizeof(next_states) / sizeof(next_states[0]))
+
/* commands received by milter */
static cmdfct cmds[] =
{
@@ -1076,6 +1078,8 @@ trans_ok(old, new)
int s, n;
s = old;
+ if (s >= SIZE_NEXT_STATES)
+ return false;
do
{
/* is this state transition allowed? */
@@ -1089,6 +1093,8 @@ trans_ok(old, new)
*/
n = s + 1;
+ if (n >= SIZE_NEXT_STATES)
+ return false;
/*
** can we actually "skip" this state?
@@ -1100,7 +1106,7 @@ trans_ok(old, new)
s = n;
else
return false;
- } while (s <= ST_LAST);
+ } while (s < SIZE_NEXT_STATES);
return false;
}
/*
OpenPOWER on IntegriCloud