aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-nbns.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-nbns.c')
-rw-r--r--epan/dissectors/packet-nbns.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/epan/dissectors/packet-nbns.c b/epan/dissectors/packet-nbns.c
index db85150b6d..aabeb6a515 100644
--- a/epan/dissectors/packet-nbns.c
+++ b/epan/dissectors/packet-nbns.c
@@ -277,14 +277,16 @@ get_nbns_name(tvbuff_t *tvb, int offset, int nbns_data_offset,
{
int name_len;
const char *name;
- char *nbname;
+ const char *nbname;
+ char *nbname_buf;
const char *pname;
char cname, cnbname;
int name_type;
char *pname_ret;
size_t index = 0;
- nbname=ep_alloc(NBNAME_BUF_LEN);
+ nbname_buf=ep_alloc(NBNAME_BUF_LEN);
+ nbname = nbname_buf;
name_len = get_dns_name(tvb, offset, nbns_data_offset, &name);
/* OK, now undo the first-level encoding. */
@@ -327,14 +329,14 @@ get_nbns_name(tvbuff_t *tvb, int offset, int nbns_data_offset,
/* Do we have room to store the character? */
if (index < NETBIOS_NAME_LEN) {
/* Yes - store the character. */
- nbname[index++] = cnbname;
+ nbname_buf[index++] = cnbname;
}
}
/* NetBIOS names are supposed to be exactly 16 bytes long. */
if (index != NETBIOS_NAME_LEN) {
/* It's not. */
- g_snprintf(nbname, NBNAME_BUF_LEN, "Illegal NetBIOS name (%lu bytes long)",
+ g_snprintf(nbname_buf, NBNAME_BUF_LEN, "Illegal NetBIOS name (%lu bytes long)",
(unsigned long)index);
goto bad;
}