aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2017-12-13 11:36:37 +0100
committerAnders Broman <a.broman58@gmail.com>2017-12-14 06:06:47 +0000
commit862a0b6472529ef6676c8bc56dd8f0be5166fd7c (patch)
treed0f06eb4ee67e07ed2b4bb51ab2485019429f608
parent11ccd830685e4037c3cce04a3dbfd2d05a5145f7 (diff)
epan: Make expert info summary text mandatory
This will make the code easier and removes the use of a generic "Expert Info" as name. Change-Id: I57ad2adb851726106ddc5009f3c6ca61721f647a Reviewed-on: https://code.wireshark.org/review/24792 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r--epan/expert.c4
-rw-r--r--epan/expert.h2
-rw-r--r--epan/wslua/wslua_proto.c5
-rw-r--r--epan/wslua/wslua_proto_expert.c5
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: