[spice-common 5/8] coverity: avoid division or modulo by zero

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 common/lines.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/lines.c b/common/lines.c
index 10ca318..e5097c4 100644
--- a/common/lines.c
+++ b/common/lines.c
@@ -412,7 +412,7 @@ miStepDash (int dist,           /* distance to step */
     totallen = 0;
     for (i = 0; i < numInDashList; i++)
         totallen += pDash[i];
-    if (totallen <= dist)
+    if (totallen > 0 && totallen <= dist)
         dist = dist % totallen;
     while (dist >= pDash[dashIndex]) {
         dist -= pDash[dashIndex];
-- 
2.7.3

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]