diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2015-11-20 18:56:45 +0100 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2015-11-21 20:30:26 +0000 |
commit | 94b9907d0f32fe4d570d94b820b20b6906a21499 (patch) | |
tree | e92475a9ca019faeaad5525549671343ba5efb84 /epan/proto.h | |
parent | 23258fb84145151680459756c64ade666e8a1773 (diff) |
Lua: Validate Proto() arguments
Check if description (protocol name) and short_name are used before
registering the protocol. This because proto_register_protocol() makes
sure there's not already a protocol with any of the names registered
and duplicates will be reported with a g_error() which terminates the
Wireshark unexpectedly.
Also check if short_name contains valid characters.
Give appropriate error messages.
Bug: 11739
Change-Id: Ib9776a2a3406ae5278ce744defd61864ebed0282
Reviewed-on: https://code.wireshark.org/review/11995
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'epan/proto.h')
-rw-r--r-- | epan/proto.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/epan/proto.h b/epan/proto.h index 2e8f30c24e..6010e6c593 100644 --- a/epan/proto.h +++ b/epan/proto.h @@ -2116,6 +2116,11 @@ WS_DLL_PUBLIC int proto_get_next_protocol(void **cookie); WS_DLL_PUBLIC header_field_info *proto_get_first_protocol_field(const int proto_id, void **cookie); WS_DLL_PUBLIC header_field_info *proto_get_next_protocol_field(const int proto_id, void **cookie); +/** Check if a protocol name is already registered. + @param name the name to search for + @return proto_id */ +WS_DLL_PUBLIC int proto_name_already_registered(const gchar *name); + /** Given a protocol's filter_name. @param filter_name the filter name to search for @return proto_id */ |