aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-knxip_decrypt.c
diff options
context:
space:
mode:
authorJaap Keuter <jaap.keuter@xs4all.nl>2019-04-23 08:34:26 +0200
committerPeter Wu <peter@lekensteyn.nl>2019-04-24 08:27:23 +0000
commit8f2277ce8ce0d77490f89067fce4338770d012b2 (patch)
treeae89f18825fd887d4ee5bb22565682bc11e3e0e9 /epan/dissectors/packet-knxip_decrypt.c
parent3a060214db93d9388843714b16655c80e547698a (diff)
KNXIP: Prevent possible buffer overrun
When reading the keyring xml file stop reading the name early enough not to overrun the name buffer. Change-Id: Ia98ddcd37b17e9865e24ef53a9146d85af1ae30f Reviewed-on: https://code.wireshark.org/review/32954 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'epan/dissectors/packet-knxip_decrypt.c')
-rw-r--r--epan/dissectors/packet-knxip_decrypt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/epan/dissectors/packet-knxip_decrypt.c b/epan/dissectors/packet-knxip_decrypt.c
index d9648257c4..3e262bb6ad 100644
--- a/epan/dissectors/packet-knxip_decrypt.c
+++ b/epan/dissectors/packet-knxip_decrypt.c
@@ -620,7 +620,7 @@ void read_knx_keyring_xml_file( const gchar* key_file, const gchar* password, co
{
if( g_ascii_isalnum( c ) || c == '_' )
{
- if( length < sizeof name + 1 )
+ if( length < sizeof name - 1 )
{
name[ length++ ] = (gchar) c;
}