Coverity DIVIDE_BY_ZERO - CID 12435 - plugins/cube/src/cube.cpp - in function: PrivateCubeScreen::updateGeometry(int, int) - Several divisions by expression "sides" which may be zero has undefined behavior. Note: screen->vpSize ().width () will always return a value >= 1.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Compiz |
Fix Released
|
Low
|
MC Return | ||
0.9.9 |
Won't Fix
|
Low
|
Unassigned | ||
compiz (Ubuntu) |
Fix Released
|
Undecided
|
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:/
CID: 12435
Checker: DIVIDE_BY_ZERO
Category: No category available
CWE definition: http://
File: /tmp/buildd/
Function: PrivateCubeScre
Code snippet:
269 *v++ = 0.0f;
270
271 for (i = sides; i >= 0; i--)
272 {
CID 12435 - DIVIDE_BY_ZERO
In expression "3.14159 / sides", division by expression "sides" which may be zero has undefined behavior.
In expression "i * 2 * 3.14159 / sides", division by expression "sides" which may be zero has undefined behavior.
273 *v++ = radius * sinf (i * 2 * M_PI / sides + M_PI / sides);
274 *v++ = -0.5 * invert;
CID 12435 - DIVIDE_BY_ZERO
In expression "3.14159 / sides", division by expression "sides" which may be zero has undefined behavior.
In expression "i * 2 * 3.14159 / sides", division by expression "sides" which may be zero has undefined behavior.
275 *v++ = radius * cosf (i * 2 * M_PI / sides + M_PI / sides);
276 }
277
278 mInvert = invert;
Related branches
- Sam Spilsbury: Approve
- PS Jenkins bot (community): Approve (continuous-integration)
- MC Return: Needs Resubmitting
-
Diff: 808 lines (+200/-178)1 file modifiedplugins/cube/src/cube.cpp (+200/-178)
Changed in compiz: | |
milestone: | none → 0.9.10.0 |
assignee: | nobody → MC Return (mc-return) |
status: | New → In Progress |
summary: |
- Coverity DIVIDE_BY_ZERO - CID 12435 + Coverity DIVIDE_BY_ZERO - CID 12435 - plugins/cube/src/cube.cpp - in + function: PrivateCubeScreen::updateGeometry(int, int) - Several division + by expression "sides" which may be zero has undefined behavior. Note: + screen->vpSize ().width () will always return a value >= 1. |
Changed in compiz: | |
milestone: | 0.9.10.0 → 0.9.10.2 |
Changed in compiz: | |
milestone: | 0.9.10.2 → 0.9.11.0 |
summary: |
Coverity DIVIDE_BY_ZERO - CID 12435 - plugins/cube/src/cube.cpp - in - function: PrivateCubeScreen::updateGeometry(int, int) - Several division - by expression "sides" which may be zero has undefined behavior. Note: - screen->vpSize ().width () will always return a value >= 1. + function: PrivateCubeScreen::updateGeometry(int, int) - Several + divisions by expression "sides" which may be zero has undefined + behavior. Note: screen->vpSize ().width () will always return a value >= + 1. |
Changed in compiz: | |
milestone: | 0.9.11.0 → 0.9.10.2 |
Changed in compiz: | |
milestone: | 0.9.10.2 → none |
status: | Fix Committed → Fix Released |
Source file with Coverity annotations.