[Openvas-commits] r9417 - in trunk/openvas-libraries: . misc

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Nov 16 17:00:49 CET 2010


Author: jan
Date: 2010-11-16 17:00:49 +0100 (Tue, 16 Nov 2010)
New Revision: 9417

Modified:
   trunk/openvas-libraries/ChangeLog
   trunk/openvas-libraries/misc/bpf_share.c
Log:
* misc/bpf_share.c (bpf_open_live): Lowered limit of for-loop by 1
because currently it would exceed the fixed field size.
This is just from reading the code and because we got a compiler
warning "array subscript is above array bounds". It is unclear
how or whether there is any positive effect in practice at all.



Modified: trunk/openvas-libraries/ChangeLog
===================================================================
--- trunk/openvas-libraries/ChangeLog	2010-11-16 15:16:18 UTC (rev 9416)
+++ trunk/openvas-libraries/ChangeLog	2010-11-16 16:00:49 UTC (rev 9417)
@@ -1,3 +1,11 @@
+2010-11-16  Jan-Oliver Wagner <jan-oliver.wagner at greenbone.net>
+
+	* misc/bpf_share.c (bpf_open_live): Lowered limit of for-loop by 1
+	because currently it would exceed the fixed field size.
+	This is just from reading the code and because we got a compiler
+	warning "array subscript is above array bounds". It is unclear
+	how or whether there is any positive effect in practice at all.
+
 2010-11-16  Michael Wiegand <michael.wiegand at greenbone.net>
 
 	Addressed compiler warnings regarding uninitialized variables and

Modified: trunk/openvas-libraries/misc/bpf_share.c
===================================================================
--- trunk/openvas-libraries/misc/bpf_share.c	2010-11-16 15:16:18 UTC (rev 9416)
+++ trunk/openvas-libraries/misc/bpf_share.c	2010-11-16 16:00:49 UTC (rev 9417)
@@ -43,7 +43,7 @@
   struct bpf_program filter_prog;
   int i;
 
-  for (i = 0; i < NUM_CLIENTS && pcaps[i]; i++)
+  for (i = 0; (i < (NUM_CLIENTS - 1)) && (pcaps[i]); i++)
     ;
 
   if (pcaps[i])



More information about the Openvas-commits mailing list