From 64c06785ea90fb37c97fc323f62bee0892107d50 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Thu, 26 Feb 2015 20:35:31 -0800 Subject: [PATCH] Again, we need a separate pointer to advance through the buffer. In this case, sometimes we step through the buffer and sometimes we don't, so we always use strlen(); use a separate pointer when we're stepping through the buffer. Change-Id: Id69898760b4c255146c6eae0ab44c1d358c9ccbd Reviewed-on: https://code.wireshark.org/review/7425 Reviewed-by: Guy Harris --- epan/dissectors/packet-sna.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/epan/dissectors/packet-sna.c b/epan/dissectors/packet-sna.c index bfda7bef4e..d66ca3f552 100644 --- a/epan/dissectors/packet-sna.c +++ b/epan/dissectors/packet-sna.c @@ -833,6 +833,7 @@ static int sna_fid_to_str_buf(const address *addr, gchar *buf, int buf_len _U_) { const guint8 *addrdata; struct sna_fid_type_4_addr sna_fid_type_4_addr; + gchar *bufp = buf; switch (addr->len) { @@ -852,10 +853,10 @@ static int sna_fid_to_str_buf(const address *addr, gchar *buf, int buf_len _U_) /* FID Type 4 */ memcpy(&sna_fid_type_4_addr, addr->data, SNA_FID_TYPE_4_ADDR_LEN); - buf = dword_to_hex(buf, sna_fid_type_4_addr.saf); - *buf++ = '.'; - buf = word_to_hex(buf, sna_fid_type_4_addr.ef); - *buf++ = '\0'; /* NULL terminate */ + bufp = dword_to_hex(bufp, sna_fid_type_4_addr.saf); + *bufp++ = '.'; + bufp = word_to_hex(bufp, sna_fid_type_4_addr.ef); + *bufp++ = '\0'; /* NULL terminate */ break; default: buf[0] = '\0';