diff options
author | Evan Huus <eapache@gmail.com> | 2014-03-08 10:43:39 -0500 |
---|---|---|
committer | Martin Kaiser <wireshark@kaiser.cx> | 2014-03-08 18:30:16 +0000 |
commit | ed1528d339096288e7f9c11ffe1a6fe33bca7712 (patch) | |
tree | 1195ec922abde57ebdf0718e7c49499bdf5c49f1 /epan/dissectors/packet-dvbci.c | |
parent | ddd9d274b96a28dd15f7fcb7702cdcaecf5b12e0 (diff) |
Ensure that the input to strtoul ends with a null.
Otherwise it runs past the end of the array into stack memory. Should fix the
intermittent DVB-CI decryption test suite failures.
Change-Id: Ice17497e661c8579baf3a546efcb5529beda6b49
Reviewed-on: https://code.wireshark.org/review/559
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Diffstat (limited to 'epan/dissectors/packet-dvbci.c')
-rw-r--r-- | epan/dissectors/packet-dvbci.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/epan/dissectors/packet-dvbci.c b/epan/dissectors/packet-dvbci.c index 032d6049b6..6c38870f8c 100644 --- a/epan/dissectors/packet-dvbci.c +++ b/epan/dissectors/packet-dvbci.c @@ -2180,7 +2180,7 @@ pref_key_string_to_bin(const gchar *key_string, unsigned char **key_bin) { int key_string_len; int i, j; - char input[2]; + char input[3]; if (!key_string || !key_bin) return -1; @@ -2188,6 +2188,7 @@ pref_key_string_to_bin(const gchar *key_string, unsigned char **key_bin) if (key_string_len != 2*AES_KEY_LEN) return -1; *key_bin = (unsigned char*)g_malloc(key_string_len/2); + input[2] = '\0'; j=0; for (i=0; i<key_string_len-1; i+=2) { |