diff options
Diffstat (limited to 'epan')
-rw-r--r-- | epan/expert.c | 4 | ||||
-rw-r--r-- | epan/expert.h | 2 | ||||
-rw-r--r-- | epan/wslua/wslua_proto.c | 5 | ||||
-rw-r--r-- | epan/wslua/wslua_proto_expert.c | 5 |
4 files changed, 7 insertions, 9 deletions
diff --git a/epan/expert.c b/epan/expert.c index aaea2939ed..ae9fb2cdb4 100644 --- a/epan/expert.c +++ b/epan/expert.c @@ -422,9 +422,7 @@ expert_register_field_array(expert_module_t *module, ei_register_info *exp, cons /* Register with the header field info, so it's display filterable */ ptr->eiinfo.hf_info.p_id = &ptr->ids->hf; - if (ptr->eiinfo.summary && ptr->eiinfo.summary[0]) { - ptr->eiinfo.hf_info.hfinfo.name = ptr->eiinfo.summary; - } + ptr->eiinfo.hf_info.hfinfo.name = ptr->eiinfo.summary; ptr->eiinfo.hf_info.hfinfo.abbrev = ptr->eiinfo.name; proto_register_field_array(module->proto_id, &ptr->eiinfo.hf_info, 1); diff --git a/epan/expert.h b/epan/expert.h index 7d331f9c42..f9a3bf8519 100644 --- a/epan/expert.h +++ b/epan/expert.h @@ -73,7 +73,7 @@ typedef struct expert_field_info { } expert_field_info; #define EXPFILL 0, NULL, 0, \ - {0, {"Expert Info", NULL, FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL}} + {0, {NULL, NULL, FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL}} typedef struct ei_register_info { expert_field *ids; /**< written to by register() function */ diff --git a/epan/wslua/wslua_proto.c b/epan/wslua/wslua_proto.c index b92e855b84..27f00ba2ec 100644 --- a/epan/wslua/wslua_proto.c +++ b/epan/wslua/wslua_proto.c @@ -755,11 +755,6 @@ int Proto_commit(lua_State* L) { eiri.eiinfo.severity = e->severity; eiri.eiinfo.summary = e->text; - if (!eiri.eiinfo.summary || !eiri.eiinfo.summary[0]) { - /* Copy this because it will be free'd when deregistering fields */ - eiri.eiinfo.hf_info.hfinfo.name = g_strdup(eiri.eiinfo.hf_info.hfinfo.name); - } - if (e->ids.ei != EI_INIT_EI || e->ids.hf != EI_INIT_HF) { return luaL_error(L,"expert fields can be registered only once"); } diff --git a/epan/wslua/wslua_proto_expert.c b/epan/wslua/wslua_proto_expert.c index feac031c4d..82c4868c21 100644 --- a/epan/wslua/wslua_proto_expert.c +++ b/epan/wslua/wslua_proto_expert.c @@ -82,6 +82,11 @@ WSLUA_CONSTRUCTOR ProtoExpert_new(lua_State* L) { return 0; } + if (!text[0]) { + luaL_argerror(L, WSLUA_ARG_ProtoExpert_new_TEXT, "Empty text"); + return 0; + } + switch (group) { case PI_CHECKSUM: case PI_SEQUENCE: |