This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

prot_register_field_array error

0

Hello all,

i just updated a custom plugin to wireshark version 1.12. This plugin worked fine until version 1.11. So I compiled wireshark version 1.12 and used the new sources to build the plugin.

But when I try to start Wireshark with this plugin, it always crashes at startup. It seems to be a problem with proto_register_field_array. When I remove this function from the code, wireshark starts.

The code looks like that:

static hf\_register\_info hf[] = {
{ &hf\_prio,
{   "PRIO-Bit" , "iec104.prio", FT\_UINT8,BASE\_DEC,NULL,0x0,
     "", HFILL}},  
{ &hf_serial2,
{   "Serial" , "iec104.serial2", FT\_UINT32,BASE\_DEC,NULL,0x0,
     "", HFILL}},
}

proto_iec104 = proto_register_protocol(DECODERNAME, DECODERNAMEPREFS, DECODERKURZNAME); proto_register_field_array(proto_iec104, hf, array_length(hf));

I am using Windows 7 64-bit.

Do I have to use another function instead of proto_register_field_array? Or maybe is there a known bug with this function?

Best regards

asked 04 Sep ‘14, 00:24

dranigl's gravatar image

dranigl
14668
accept rate: 0%

edited 04 Sep ‘14, 06:29

JeffMorriss's gravatar image

JeffMorriss ♦
6.2k572

Try replacing the empty string "" with null.

(04 Sep ‘14, 02:25) Anders ♦

You might also want to try running tools/checkhf.pl and tools/checkAPIs.pl on your code: they might point out what’s wrong with your hf array.

(04 Sep ‘14, 06:31) JeffMorriss ♦