After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 778602 - Add assertions to guard against division by zero on sample text paths
Add assertions to guard against division by zero on sample text paths
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: pango-maint
pango-maint
Depends on:
Blocks:
 
 
Reported: 2017-02-14 11:16 UTC by Philip Withnall
Modified: 2017-02-14 12:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add assertions to guard against division by zero on sample text paths (3.79 KB, patch)
2017-02-14 11:16 UTC, Philip Withnall
committed Details | Review

Description Philip Withnall 2017-02-14 11:16:03 UTC
Trivial patch attached.
Comment 1 Philip Withnall 2017-02-14 11:16:07 UTC
Created attachment 345722 [details] [review]
Add assertions to guard against division by zero on sample text paths

There are a few code paths where pango_utf8_strwidth() is called on
language-specific sample text. The sample text should have been chosen
to never have a zero width, but we should add some assertions to ensure
that’s the case. This guides static analysers into the right analysis.

Coverity IDs: 1391697, 1391698, 1391699

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Comment 2 Matthias Clasen 2017-02-14 11:58:46 UTC
Review of attachment 345722 [details] [review]:

hmm, ok
Comment 3 Philip Withnall 2017-02-14 12:27:49 UTC
Attachment 345722 [details] pushed as e4ea2d2 - Add assertions to guard against division by zero on sample text paths