aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-mgcp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2019-07-24 13:58:02 -0700
committerGuy Harris <guy@alum.mit.edu>2019-07-24 22:21:13 +0000
commit04264a23aac60bb5a683a38d63c01526940e64ce (patch)
treeb4b90f4114bb2aa0c0e68d4c5ffad5cff789c31c /epan/dissectors/packet-mgcp.c
parentd86f3e5228685250f3f2756c185bf73bed6ab726 (diff)
Use tvb_get_raw_bytes_as_string() to fetch the verb and reply code.
Change-Id: I615feb257274fdc44b8791078c0da512a4a7bd88 Reviewed-on: https://code.wireshark.org/review/34076 Petri-Dish: Guy Harris <guy@alum.mit.edu> Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors/packet-mgcp.c')
-rw-r--r--epan/dissectors/packet-mgcp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/epan/dissectors/packet-mgcp.c b/epan/dissectors/packet-mgcp.c
index 77b1f76901..8780326c28 100644
--- a/epan/dissectors/packet-mgcp.c
+++ b/epan/dissectors/packet-mgcp.c
@@ -684,7 +684,7 @@ static gboolean is_mgcp_verb(tvbuff_t *tvb, gint offset, gint maxlength, const g
return FALSE;
/* Read the string into 'word' and see if it looks like the start of a verb */
- if ((maxlength >= 4) && tvb_get_nstringz0(tvb, offset, sizeof(word), word))
+ if ((maxlength >= 4) && tvb_get_raw_bytes_as_string(tvb, offset, word, sizeof word))
{
if (((g_ascii_strncasecmp(word, "EPCF", 4) == 0) && (*verb_name = "EndpointConfiguration")) ||
((g_ascii_strncasecmp(word, "CRCX", 4) == 0) && (*verb_name = "CreateConnection")) ||
@@ -733,7 +733,7 @@ static gboolean is_mgcp_verb(tvbuff_t *tvb, gint offset, gint maxlength, const g
static gboolean is_mgcp_rspcode(tvbuff_t *tvb, gint offset, gint maxlength)
{
gboolean returnvalue = FALSE;
- guint8 word[4];
+ char word[4];
/* see the comment in is_mgcp_verb() */
if (tvb_captured_length_remaining(tvb, offset) < (gint)sizeof(word))
@@ -742,7 +742,7 @@ static gboolean is_mgcp_rspcode(tvbuff_t *tvb, gint offset, gint maxlength)
/* Do 1st 3 characters look like digits? */
if (maxlength >= 3)
{
- tvb_get_nstringz0(tvb, offset, sizeof(word), word);
+ tvb_get_raw_bytes_as_string(tvb, offset, word, sizeof word);
if (g_ascii_isdigit(word[0]) && g_ascii_isdigit(word[1]) && g_ascii_isdigit(word[2]))
{
returnvalue = TRUE;