Wireshark mailing list archives
Re: FT_BYTES hf with len==0
From: Martin Kaiser <lists () kaiser cx>
Date: Fri, 20 Dec 2013 18:25:19 +0100
Thus wrote Martin Kaiser (lists () kaiser cx):
5392 label_fill(label_str, 0, hfinfo, 5393 (bytes) ? bytes_to_str(bytes, fvalue_length(&fi->value)) : "<MISSING>"); 5394 break;
It'd be good to make them consistent, allow empty bytes (+1 from me) or assert in both place.
ok, I'll change this.
done in r54290.
I've just found one more issue with empty FT_BYTES: When I click on an empty FT_BYTES element in the tree and select Apply as Filter / Selected, wireshark creates a filter expression <filter name>== that results in a syntax error. This is created by construct_match_selected_string(), which calls fvalue_to_string_repr() and uses the fvalue's string representation by default. One way to resolve this would be to change an empty FT_BYTES' string representation from <nothing> to "" (as <filter name>=="" is a valid filter expression). See the attached patch. Is that ok or does it break someone else's code? Should I check for FTREPR_DFILTER and modify the representation for empty FT_BYTES only in this case?
Attachment:
bytes_repr.patch
Description:
___________________________________________________________________________ Sent via: Wireshark-dev mailing list <wireshark-dev () wireshark org> Archives: http://www.wireshark.org/lists/wireshark-dev Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev mailto:wireshark-dev-request () wireshark org?subject=unsubscribe
Current thread:
- FT_BYTES hf with len==0 Martin Kaiser (Dec 16)
- Re: FT_BYTES hf with len==0 Jakub Zawadzki (Dec 16)
- Re: FT_BYTES hf with len==0 Martin Kaiser (Dec 18)
- Re: FT_BYTES hf with len==0 Martin Kaiser (Dec 20)
- Re: FT_BYTES hf with len==0 Martin Kaiser (Dec 20)
- Re: FT_BYTES hf with len==0 Martin Kaiser (Dec 18)
- Re: FT_BYTES hf with len==0 Guy Harris (Dec 18)
- Re: FT_BYTES hf with len==0 Jakub Zawadzki (Dec 16)
- Re: FT_BYTES hf with len==0 Guy Harris (Dec 16)
- Re: FT_BYTES hf with len==0 Martin Kaiser (Dec 18)