On Wed, Jul 15, 2015 at 10:18:29PM -0700, Joe Stringer wrote:
> This code attempts to first check whether another error was detected for
> the string it is parsing, then if it's not at the end of the tokens,
> report an error. However, 'errorp' is always a valid pointer to a
> 'char *', so the first check in this statement always evaluates false.
> 
> Furthermore, this behaviour may be optimised out by modern compilers
> due to the prior dereference in expr_parse(). Fix this to check the
> actual value of *errorp.
> 
> Found by MIT STACK analyzer.
> 
> Signed-off-by: Joe Stringer <joestrin...@nicira.com>

The tests should have caught this bug but I forgot to put in a test!

Therefore please squash in the following:

diff --git a/tests/ovn.at b/tests/ovn.at
index 261e32a..d1696de 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -255,6 +255,8 @@ eth.src > 00:00:00:00:11:11/00:00:00:00:ff:ff => Only == 
and != operators may be
 ip4.src == ::1 => 128-bit constant is not compatible with 32-bit field ip4.src.
 
 1 == eth.type == 2 => Range expressions must have the form `x < field < y' or 
`x > field > y', with each `<' optionally replaced by `<=' or `>' by `>=').
+
+eth.dst[40] x => Extra tokens at end of input.
 ]])
 sed 's/ =>.*//' test-cases.txt > input.txt
 sed 's/.* => //' test-cases.txt > expout

Acked-by: Ben Pfaff <b...@nicira.com>

Thanks,

Ben.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to