Wireshark-dev: Re: [Wireshark-dev] [Wireshark-commits] rev 47188: /trunk/ui/gtk/ /trunk/ui/gtk/
On Jan 20, 2013, at 1:45 PM, jake@xxxxxxxxxxxxx wrote:
> http://anonsvn.wireshark.org/viewvc/viewvc.cgi?view=rev&revision=47188
>
> User: jake
> Date: 2013/01/20 01:45 PM
>
> Log:
> Fix for CID 715142.
> Be aware that the short-circuit evaluation only applies to the
> first operand of a logical AND expression.
...but if the second operand is itself a logical AND expression, short-circuit evaluation applies to the first operand of *that* expression. I'm not sure what that change actually changes; would not both evaluate as
if global_capture_opts.num_selected == 0
then
if prefs.capture_device != NULL
then
if *prefs_p->capture_device != '\0'
then
TRUE
else
FALSE
else
FALSE
else
FALSE
(expression syntax is C syntax, if/then syntax isn't)?
At least when I look at 715142, I think the problem about which it's complaining is that, unless prefs_p == &prefs, establishing that prefs.capture_devices != NULL does nothing to establish that prefs_p->capture_devices is != NULL, and therefore does nothing to establish that *prefs_p->capture_device is a valid reference.