diff options
author | Martin Mathieson <martin.mathieson@keysight.com> | 2020-06-01 17:51:27 +0100 |
---|---|---|
committer | Martin Mathieson <martin.r.mathieson@googlemail.com> | 2020-06-01 17:57:13 +0000 |
commit | 75cc8d769195ae1004e4575a2341f655aaadc17b (patch) | |
tree | 5848d52c902d9aefd7572a51fa98e3cf2fce266e | |
parent | 060f876f9794a563267578cca8fe9f5f17d3538d (diff) |
PCNFSD: Add missing proto_item for tree.
From a recent cppcheck scan:
epan/dissectors/packet-pcnfsd.c:222: style: Condition 'password_item' is always false
Change-Id: I90a210899bd1e7a6de350322577e5e1598e078d5
Reviewed-on: https://code.wireshark.org/review/37353
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
-rw-r--r-- | epan/dissectors/packet-pcnfsd.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/epan/dissectors/packet-pcnfsd.c b/epan/dissectors/packet-pcnfsd.c index b84979361a..306c8a5250 100644 --- a/epan/dissectors/packet-pcnfsd.c +++ b/epan/dissectors/packet-pcnfsd.c @@ -32,6 +32,7 @@ static int hf_pcnfsd_procedure_v2 = -1; static int hf_pcnfsd_auth_client = -1; static int hf_pcnfsd_auth_ident_obscure = -1; static int hf_pcnfsd_auth_ident_clear = -1; +static int hf_pcnfsd_auth_password = -1; static int hf_pcnfsd_auth_password_obscure = -1; static int hf_pcnfsd_auth_password_clear = -1; static int hf_pcnfsd_comment = -1; @@ -200,8 +201,9 @@ dissect_pcnfsd2_auth_call(tvbuff_t *tvb, packet_info *pinfo _U_, offset = newoffset; - password_tree = proto_tree_add_subtree(tree, tvb, - offset, -1, ett_pcnfsd_auth_password, NULL, "Authentication Password"); + password_item = proto_tree_add_string_format(tree, hf_pcnfsd_auth_password, + tvb, 0, 0, "", "Authentication Password"); + password_tree = proto_item_add_subtree(password_item, ett_pcnfsd_auth_password); newoffset = dissect_rpc_string(tvb, password_tree, hf_pcnfsd_auth_password_obscure, offset, &password); @@ -353,6 +355,9 @@ proto_register_pcnfsd(void) { &hf_pcnfsd_auth_ident_clear, { "Clear Ident", "pcnfsd.auth.ident.clear", FT_STRING, BASE_NONE, NULL, 0, "Authentication Clear Ident", HFILL }}, + { &hf_pcnfsd_auth_password, { + "Password", "pcnfsd.auth.password", FT_STRING, BASE_NONE, + NULL, 0, NULL, HFILL }}, { &hf_pcnfsd_auth_password_obscure, { "Obscure Password", "pcnfsd.auth.password.obscure", FT_STRING, BASE_NONE, NULL, 0, "Authentication Obscure Password", HFILL }}, |