Bug 1087031 - nss.Certificate.check_ocsp_status segfaults
Summary: nss.Certificate.check_ocsp_status segfaults
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-nss
Version: rawhide
Hardware: All
OS: All
unspecified
medium
Target Milestone: ---
Assignee: John Dennis
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-04-13 08:57 UTC by computerzerstoerer
Modified: 2014-06-15 01:54 UTC (History)
1 user (show)

Fixed In Version: python-nss-0.15.0-1.fc20
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-05-02 18:38:23 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description computerzerstoerer 2014-04-13 08:57:13 UTC
Steps to Reproduce:
1. Get an nss.Certificate object somehow
2. Invoke check_ocsp_status on that object

Actual results:
segfault

Expected results:
no segfault


Additional info:
The bug is in src/py_nss.c:9185

   9185     if (!PyArg_ParseTuple(args, "O&O&:check_ocsp_status",
   9186                           &CertDBType, &py_certdb,
   9187                           PRTimeConvert, &pr_time)) {

The format string expects two object arguments with converter functions. This works perfectly fine for the time argument: PyArg_ParseTuple invokes PRTimeConvert which then converts the time and writes it into pr_time. However, CertDBType is not a function, it's a PyTypeObject variable. PyArg_ParseTuple will then invoke the *data* and crash.

The fix is trivial:

9185c9185
<     if (!PyArg_ParseTuple(args, "O&O&:check_ocsp_status",
---
>     if (!PyArg_ParseTuple(args, "O!O&:check_ocsp_status",

Comment 1 John Dennis 2014-05-02 18:38:23 UTC
Thank you for the bug report. Good catch. Clear explanation.

Fixed in rawhide, python-nss-0.15.0-2.fc21

Fixed in F20: python-nss-0.14.0-3.fc20

Comment 2 Fedora Update System 2014-06-10 23:11:14 UTC
python-nss-0.15.0-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/python-nss-0.15.0-1.fc20

Comment 3 Fedora Update System 2014-06-15 01:54:13 UTC
python-nss-0.15.0-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.