forked from osmocom/wireshark
dfilter: Forbid protocol filter names beginning with '-'
Reducing the namespace for protocol names makes the display filter grammar simpler and less ambiguous and error prone. We can't easily impose stricter restrictions without breaking backward compatibility but names starting with '-' are a pathological case because of negative numbers and byte slices and in the unlikely event that any such names exist they should be fixed.
This commit is contained in:
parent
6d4a463620
commit
06890ea379
|
@ -7385,6 +7385,12 @@ check_valid_filter_name_or_fail(const char *filter_name)
|
|||
ws_error("Protocol filter name \"%s\" is invalid because it is a reserved keyword."
|
||||
" This might be caused by an inappropriate plugin or a development error.", filter_name);
|
||||
}
|
||||
|
||||
/* First character cannot be '-'. */
|
||||
if (filter_name[0] == '-') {
|
||||
ws_error("Protocol filter name \"%s\" cannot begin with '-'."
|
||||
" This might be caused by an inappropriate plugin or a development error.", filter_name);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
|
|
Loading…
Reference in New Issue