aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Kaiser <wireshark@kaiser.cx>2013-03-30 19:16:51 +0000
committerMartin Kaiser <wireshark@kaiser.cx>2013-03-30 19:16:51 +0000
commit77c9d43ce42c19d7cf4815ceedeb8b4d55d7d040 (patch)
tree2af9080c4e3f707a57382e3441cde7c0b42e4562
parent94ea9af46ce1c751b340dcccc8b07976a3f48b7c (diff)
coverity 993742: potential division by zero
svn path=/trunk/; revision=48659
-rw-r--r--epan/dissectors/packet-homeplug-av.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/epan/dissectors/packet-homeplug-av.c b/epan/dissectors/packet-homeplug-av.c
index da4968adbb..96ba0ccfd0 100644
--- a/epan/dissectors/packet-homeplug-av.c
+++ b/epan/dissectors/packet-homeplug-av.c
@@ -2886,9 +2886,12 @@ dissect_homeplug_av_tone_map_carrier(ptvcursor_t *cursor, guint16 num_carriers)
total_snr += (hi_snr+lo_snr);
}
- /* Append to TM-Subtree: total modulated bits, number of active carriers, Average #Bits/Carrier, Average SNR/Carrier */
- proto_item_append_text(ittm, " (Total #ModulatedBits=%d bit, Active #Carriers=%d, Average #Bits/Carrier=%.2f bit), Average SNR/Carrier=%.2f dB)",
- total_bits, num_act_carriers, (float) total_bits/num_act_carriers, (float) total_snr/num_act_carriers );
+ if (num_act_carriers)
+ {
+ /* Append to TM-Subtree: total modulated bits, number of active carriers, Average #Bits/Carrier, Average SNR/Carrier */
+ proto_item_append_text(ittm, " (Total #ModulatedBits=%d bit, Active #Carriers=%d, Average #Bits/Carrier=%.2f bit), Average SNR/Carrier=%.2f dB)",
+ total_bits, num_act_carriers, (float) total_bits/num_act_carriers, (float) total_snr/num_act_carriers );
+ }
ptvcursor_pop_subtree(cursor);
}