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 777314 - BIO methods return 1 for success but they're checked against 0
BIO methods return 1 for success but they're checked against 0
Status: RESOLVED FIXED
Product: glib-openssl
Classification: Other
Component: general
unspecified
Other All
: Normal blocker
: ---
Assigned To: glib-openssl Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-01-16 09:53 UTC by Daniele Ricci
Modified: 2017-04-04 08:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for the issue (1.60 KB, patch)
2017-01-16 09:53 UTC, Daniele Ricci
committed Details | Review

Description Daniele Ricci 2017-01-16 09:53:18 UTC
Created attachment 343537 [details] [review]
Patch for the issue

BIO_meth_* functions return 1 on success, however they're checked against 0, causing BIO_g_tls() to return NULL, which is unchecked by the caller, resulting in a null pointer access and, consequently, crash.

The simple patch I've attached fixes this problem by simply inverting the condition. Tested on Linux only, but I don't see why it shouldn't work on other systems as well.

Originally posted on GitHub: https://github.com/GNOME/glib-openssl/pull/2
Comment 1 Ignacio Casal Quinteiro (nacho) 2017-04-04 08:39:16 UTC
Thanks. For now I was only testing on 1.0.2 so clearly I did not realized about this issue.