Ethereal-dev: [Ethereal-dev] packet-isakmp.c using tvb_get_ptr() and casts pointer to struct..

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "Yaniv Kaul" <ykaul@xxxxxxxxxxxxxxxx>
Date: Wed, 14 Aug 2002 16:44:02 +0200
I've noticed packet-isakmp.c does:
hdr = (struct isakmp_hdr *)tvb_get_ptr(tvb, 0, sizeof (struct isakmp_hdr));

which according to README.developer is no-no-no ("Don't fetch data from
packets by getting a pointer to data in the packet
with "tvb_get_ptr()", casting that pointer to a pointer to a structure,
and dereferencing that pointer.").

I'll fix it if I can get an authoritive 'yes, it's wrong' answr.

TIA,
Y.