aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2019-06-12 13:22:37 -0700
committerGuy Harris <guy@alum.mit.edu>2019-06-12 20:47:37 +0000
commit1000f3f6d5b2b4b399eda5fb5d9e139c4577fb03 (patch)
treecf1a2b87a392796abdc4edac5c07432102721043
parent2def295022a8ab6cc932e7f47096cdc80190547b (diff)
Don't assume dissect_smb2_olb_string() returned a non-null pointer.
It can return null on error; don't add the string it returned to the Info column if it didn't return a string. Fixes Coverity CID 1445960. Change-Id: I73b1585e95e39ad998f10d2a017f33fb3d54e7a7 Reviewed-on: https://code.wireshark.org/review/33569 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r--epan/dissectors/packet-smb2.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/epan/dissectors/packet-smb2.c b/epan/dissectors/packet-smb2.c
index 1cade4d065..58ee69afc6 100644
--- a/epan/dissectors/packet-smb2.c
+++ b/epan/dissectors/packet-smb2.c
@@ -3625,8 +3625,10 @@ dissect_smb2_tree_connect_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree
g_snprintf((char *)si->saved->extra_info,olb.len+1,"%s",buf);
}
- col_append_fstr(pinfo->cinfo, COL_INFO, " Tree: %s",
- format_text(wmem_packet_scope(), buf, strlen(buf)));
+ if (buf) {
+ col_append_fstr(pinfo->cinfo, COL_INFO, " Tree: %s",
+ format_text(wmem_packet_scope(), buf, strlen(buf)));
+ }
return offset;
}