diff options
author | Gerald Combs <gerald@wireshark.org> | 2018-11-27 12:06:47 -0800 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2018-11-27 21:28:09 +0000 |
commit | d53ff85d409367ee6538326147c8bb545bd4adb3 (patch) | |
tree | a55e3d6bdf1099c1b456ba4b2f34b34d2da3500b /epan/dissectors/packet-zbee-zcl-lighting.c | |
parent | 284463cc7cd672e1844050098df2ff1682037d5f (diff) |
ZigBee ZCL: Fix a divide-by-zero.
Fix a divide-by-zero in decode_color_temperature.
Bug: 15281
Change-Id: I9460ffc85f6fe6b954c1810c3a80588c1aa4fec2
Reviewed-on: https://code.wireshark.org/review/30806
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-zbee-zcl-lighting.c')
-rw-r--r-- | epan/dissectors/packet-zbee-zcl-lighting.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/epan/dissectors/packet-zbee-zcl-lighting.c b/epan/dissectors/packet-zbee-zcl-lighting.c index 4a4fc5c069..b68a003966 100644 --- a/epan/dissectors/packet-zbee-zcl-lighting.c +++ b/epan/dissectors/packet-zbee-zcl-lighting.c @@ -879,7 +879,11 @@ decode_color_xy(gchar *s, guint16 value) static void decode_color_temperature(gchar *s, guint16 value) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d [Mired] (%d [K])", value, 1000000/value); + if (value == 0) { + g_snprintf(s, ITEM_LABEL_LENGTH, "%u [Mired]", value); + } else { + g_snprintf(s, ITEM_LABEL_LENGTH, "%u [Mired] (%u [K])", value, 1000000/value); + } return; } /*decode_color_temperature*/ |