Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-bugs: [Wireshark-bugs] [Bug 2162] for() loop evaluation order in ep_strndup() can trig

Date: Fri, 4 Jan 2008 07:43:06 +0000 (GMT)
http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2162





------- Comment #4 from jyoung@xxxxxxx  2008-01-04 07:43 GMT -------
Hello Japp,

In response to comment #2...

Doesn't C's "Precedence and Order of Evaluation" come into play here?  

Citing one quick googled link:

  http://msdn2.microsoft.com/en-us/library/2bxt6kc4.aspx

The logical-AND (&&) constitutes a sequence point.  MSDN goes on to state that
"Logical operators also guarantee evaluation of their operands from left to
right." and they go onto follow with a "'short-circuit' evaluation" example.

I believe the patch is necessary.  

And with the patch applied, these particular valgrind messages stopped, so it
makes looking for other potentional problems with valgrind easier! ;-) 


-- 
Configure bugmail: http://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.