From 3b3c845f5c0383f3db48e610d711db48b317da1c Mon Sep 17 00:00:00 2001
From: Pascal Quantin <pascal.quantin@gmail.com>
Date: Mon, 23 Jun 2014 22:06:05 +0200
Subject: [PATCH 4/4] Initialize whole buffer in GPRS Mobility and Session
 Management dissector

Bug: 10216
Change-Id: I572a7a6ce0f816063f02397b667dd46c990cf73e
Reviewed-on: https://code.wireshark.org/review/2583
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
(cherry picked from commit dd7134d907350ccc574cdec596f4162860912bb9)
Reviewed-on: https://code.wireshark.org/review/2585
(cherry picked from commit abae269b462b0b39fda7a21b24a53d0033662662)
Reviewed-on: https://code.wireshark.org/review/3436
Reviewed-by: Balint Reczey <balint@balintreczey.hu>
---
 epan/dissectors/packet-gsm_a_gm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/epan/dissectors/packet-gsm_a_gm.c b/epan/dissectors/packet-gsm_a_gm.c
index 6517aec..1b09d53 100644
--- a/epan/dissectors/packet-gsm_a_gm.c
+++ b/epan/dissectors/packet-gsm_a_gm.c
@@ -3746,7 +3746,7 @@ de_sm_apn(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, g
 	curr_offset = offset;
 
 	/* init buffer and copy it */
-	memset(str, 0, MAX_APN_LENGTH);
+	memset(str, 0, MAX_APN_LENGTH+1);
 	tvb_memcpy(tvb, str, offset, len<MAX_APN_LENGTH?len:MAX_APN_LENGTH);
 
 	curr_len = 0;
-- 
2.0.1

