aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-pdcp-lte.c
diff options
context:
space:
mode:
authorMartin Mathieson <martin.r.mathieson@googlemail.com>2014-01-14 16:22:44 +0000
committerMartin Mathieson <martin.r.mathieson@googlemail.com>2014-01-14 16:22:44 +0000
commit293f8ca2478e075a39d06a1f3fe5f5f1bbdb0c2b (patch)
treea77634338047663cfb933f03a0000bc9434533c2 /epan/dissectors/packet-pdcp-lte.c
parentb948c75dfefcc726c7ade21d94259bdf68bb84b4 (diff)
Make sure we allocate bytes for snow3g at least rounded up to next 4 byte boundary
svn path=/trunk/; revision=54786
Diffstat (limited to 'epan/dissectors/packet-pdcp-lte.c')
-rw-r--r--epan/dissectors/packet-pdcp-lte.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/epan/dissectors/packet-pdcp-lte.c b/epan/dissectors/packet-pdcp-lte.c
index fe6c24df6b..88613a81f1 100644
--- a/epan/dissectors/packet-pdcp-lte.c
+++ b/epan/dissectors/packet-pdcp-lte.c
@@ -41,7 +41,7 @@
#endif /* HAVE_LIBGCRYPT */
/* Define this symbol if you have a working implementation of SNOW3G f8() and f9() available */
-/* #define HAVE_SNOW3G */
+#define HAVE_SNOW3G
#ifdef HAVE_SNOW3G
#include <epan/snow3g_algorithm.h>
#endif
@@ -1453,7 +1453,7 @@ static tvbuff_t *decipher_payload(tvbuff_t *tvb, packet_info *pinfo, int *offset
if (pdu_security_settings->ciphering == eea1) {
/* Extract the encrypted data into a buffer */
payload_length = tvb_length_remaining(tvb, *offset);
- decrypted_data = (guint8 *)g_malloc0(payload_length);
+ decrypted_data = (guint8 *)g_malloc0(payload_length+4);
tvb_memcpy(tvb, decrypted_data, *offset, payload_length);
/* Do the algorithm */
@@ -1506,7 +1506,7 @@ static guint32 calculate_digest(pdu_security_settings_t *pdu_security_settings,
{
guint8 *mac;
gint message_length = tvb_length_remaining(tvb, offset) - 4;
- guint8 *message_data = (guint8 *)g_malloc0(message_length+1);
+ guint8 *message_data = (guint8 *)g_malloc0(message_length+5);
message_data[0] = header;
tvb_memcpy(tvb, message_data+1, offset, message_length);