Subject: CVS commit: src/dist/pf/sbin/pfctl
To: None <source-changes@NetBSD.org>
From: Christos Zoulas <christos@netbsd.org>
List: source-changes
Date: 03/21/2006 20:47:27
Module Name:	src
Committed By:	christos
Date:		Tue Mar 21 20:47:27 UTC 2006

Modified Files:
	src/dist/pf/sbin/pfctl: pfctl_parser.c

Log Message:
Coverity CID 1514: Don't access static array beyond the end of it.
In this case PFTM_MAX == 20 and sizeof(pf_timeouts) / sizeof(pf_timeouts[0])
== 21, using a loop with the size of the array and checking for reaching the
end of the loop via j == PFTM_MAX does not work. Change the loop to use
PFTM_MAX as the upper bound and add an assertion in the code to make sure
that pf_timeouts is large enough. Finally remove last NULL element of the
array so that the array has 20 elements again.


To generate a diff of this commit:
cvs rdiff -r1.7 -r1.8 src/dist/pf/sbin/pfctl/pfctl_parser.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.