aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-x11.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-x11.c')
-rw-r--r--epan/dissectors/packet-x11.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/epan/dissectors/packet-x11.c b/epan/dissectors/packet-x11.c
index e76e6a10af..a81903ed3d 100644
--- a/epan/dissectors/packet-x11.c
+++ b/epan/dissectors/packet-x11.c
@@ -4807,7 +4807,9 @@ dissect_x11_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
UNUSED(24);
LISTofKEYSYM(keysyms, state->keycodemap,
state->request.GetKeyboardMapping.first_keycode,
- length / state->keysyms_per_keycode,
+ /* XXX - length / state->keysyms_per_keycode can raise a division by zero,
+ * don't know if this is the *right* way to fix it ... */
+ state->keysyms_per_keycode ? length / state->keysyms_per_keycode : 0,
state->keysyms_per_keycode);
break;