From 85ae3a808668f783a820c642b86d375af5cc1b77 Mon Sep 17 00:00:00 2001 From: Ulf Lamping Date: Wed, 21 Sep 2005 10:29:22 +0000 Subject: 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 :-) svn path=/trunk/; revision=15927 --- epan/dissectors/packet-x11.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'epan/dissectors/packet-x11.c') 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; -- cgit v1.2.3