aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-x11.c
diff options
context:
space:
mode:
authorulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>2005-09-21 10:29:22 +0000
committerulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>2005-09-21 10:29:22 +0000
commit910d0b2ae3196f87ca852a36a81bf7e871ece7f7 (patch)
treea1e1f867790847bbdf9862b908f1fc8138ef4caa /epan/dissectors/packet-x11.c
parent295ebfce4fcbd675d0626bcb7e066af72bfc38bb (diff)
fix #372: the bug raised a "division by zero" exception. I've add a check for this and simply replaced the expression with 0 in that case. Don't know if it's correct to do so, but fixes the exception at least :-)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15927 f5534014-38df-0310-8fa8-9805f1628bb7
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;