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 791257 - vapi: Fix potential null pointer dereference in strjoinv()
vapi: Fix potential null pointer dereference in strjoinv()
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Arrays
unspecified
Other All
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2017-12-05 12:01 UTC by Philip Withnall
Modified: 2017-12-05 15:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
vapi: Fix potential null pointer dereference in strjoinv() (1.37 KB, patch)
2017-12-05 12:01 UTC, Philip Withnall
committed Details | Review

Description Philip Withnall 2017-12-05 12:01:24 UTC
Trivial patch attached.
Comment 1 Philip Withnall 2017-12-05 12:01:28 UTC
Created attachment 365021 [details] [review]
vapi: Fix potential null pointer dereference in strjoinv()

The logic in the ‘is the array null or empty’ check was disjunctive
rather than conjunctive. If (str_array == null), the condition would
have short-circuited and tried to evaluate str_array.length, which would
have crashed.

Coverity CID: #1462389 (spotted when scanning Tracker)

Signed-off-by: Philip Withnall <withnall@endlessm.com>