diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2005-09-21 10:29:22 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2005-09-21 10:29:22 +0000 |
commit | 85ae3a808668f783a820c642b86d375af5cc1b77 (patch) | |
tree | a1e1f867790847bbdf9862b908f1fc8138ef4caa /epan/dissectors/packet-x11.c | |
parent | 853067c739b7349234b510f5972fe9e2013f4814 (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 :-)
svn path=/trunk/; revision=15927
Diffstat (limited to 'epan/dissectors/packet-x11.c')
-rw-r--r-- | epan/dissectors/packet-x11.c | 4 |
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; |