[Openvas-devel] [Openvas-commits] r9417 - in trunk/openvas-libraries: . misc
Matthew Mundell
matthew.mundell at greenbone.net
Tue Nov 16 19:22:53 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/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])
Surely the positive effect is that this would have been out of bounds if
pcaps was full, because i would have been NUM_CLIENTS.
More information about the Openvas-devel
mailing list