Wireshark-bugs: [Wireshark-bugs] [Bug 7060] Global variables - Buildbot crash output: fuzz-2012-
Comment # 8
on bug 7060
from Evan Huus
(In reply to comment #7)
> (In reply to comment #6)
> > For the cases in this bug at least, why can't we use p_add_proto_data and
> > p_get_proto_data with ep_ allocated data? Unless I'm missing something, they
> > are only being used in packet scope?
>
> p_add_proto_data() is supposed to add *session*-scope data to a packet; if
> you aren't going to need it to dissect the packet in question in the future,
> you don't need to add it, and if you *are* going to need it to dissect the
> packet in question in the future, it has to stay around as long as you have
> the capture in question open.
>
> There is no reason whatsoever to attach packet-scope data to a packet.
I believe the use case we're trying to solve here is passing data between
different functions in a dissector where you would normally just pass a
parameter, but can't due to the fact that intermediate code is generated from
ASN1.
The current solution is globals, which is ugly. Attaching packet-scope data to
a packet is a slight improvement over that. Alternatively I guess the ASN1
generator could add a void* parameter to all its functions that it passes
around everywhere, but it's unneeded in 99% of cases and would be quite a lot
of work.
I don't know that there is a good solution here.
You are receiving this mail because:
- You are watching all bug changes.