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 778656 - pango-layout: Add a clarifying assertion
pango-layout: Add a clarifying assertion
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-15 10:01 UTC by Philip Withnall
Modified: 2017-02-16 10:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
pango-layout: Add a clarifying assertion (1.28 KB, patch)
2017-02-15 10:01 UTC, Philip Withnall
committed Details | Review

Description Philip Withnall 2017-02-15 10:01:46 UTC
Make the static analyser’s job a little easier.
Comment 1 Philip Withnall 2017-02-15 10:01:50 UTC
Created attachment 345791 [details] [review]
pango-layout: Add a clarifying assertion

In pango_layout_index_to_pos(), it looks like layout_line could be
dereferenced while still NULL in the first loop iteration. This is not
the case, as other bits of PangoLayout ensure its start_index is always
0, so this branch is never taken. Add an assertion to clarify that and
guide static analysis.

Coverity ID: 1391700

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Comment 2 Matthias Clasen 2017-02-15 18:34:17 UTC
Review of attachment 345791 [details] [review]:

looks ok to me
Comment 3 Philip Withnall 2017-02-16 10:47:26 UTC
Attachment 345791 [details] pushed as bfe9cdc - pango-layout: Add a clarifying assertion