Coverity DIVIDE_BY_ZERO - CID 13651

Bug #1109119 reported by Product Strategy Coverity Bug Uploader
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
overlay-scrollbar
Status tracked in Trunk
Trunk
Invalid
High
Unassigned

Bug Description

This bug is exported from the Coverity Integration Manager on Canonical's servers. For information on how this is done please see this website: https://wiki.ubuntu.com/CanonicalProductStrategy/Coverity
CID: 13651
Checker: DIVIDE_BY_ZERO
Category: No category available
CWE definition: http://cwe.mitre.org/data/definitions/571.html
File: /tmp/buildd/overlay-scrollbar-0.2.16+r359daily12.11.30/os/os-animation.c
Function: os_animation_new
Code snippet:
120 priv->update_func = update_func;
121 priv->end_func = end_func;
122 priv->user_data = user_data;
123 priv->duration = (gint64) duration * G_GINT64_CONSTANT (1000);
CID 13651 - DIVIDE_BY_ZERO
In expression "1000 / rate", division by expression "rate" which may be zero has undefined behavior.
124 priv->rate = 1000 / rate;
125
126 return animation;
127 }
128
129 /**

Revision history for this message
Product Strategy Coverity Bug Uploader (coverity-uploader) wrote : overlay-scrollbar-13.04: /tmp/buildd/overlay-scrollbar-0.2.16+r359daily12.11.30/os/os-animation.c

Source file with Coverity annotations.

Changed in overlay-scrollbar:
importance: Undecided → Medium
Revision history for this message
Allan LeSage (allanlesage) wrote :

I'm going to up the importance of this as it'll have the effect of blocking landing for any MP.

Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

Impossible, for one all the calls to this function use a defined int, which is 30, and there is:

  g_return_val_if_fail (rate != 0, NULL);

at the top of function which will return if it is ever 0.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.