This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Null pointer dereference in ndb.ndbm get when used with a default value.
Type: crash Stage: resolved
Components: Versions: Python 3.8, Python 3.7, Python 3.6, Python 3.5
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Crash in the get() method a single argument in dbm.ndbm
View: 33383
Assigned To: Nosy List: serhiy.storchaka, tmiasko
Priority: normal Keywords: patch

Created on 2017-10-25 10:25 by tmiasko, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
0001-Fix-null-pointer-dereference-in-dbm.ndbm-get.patch tmiasko, 2017-10-25 10:25 [PATCH] Fix null pointer dereference in dbm.ndbm get. review
Messages (3)
msg304977 - (view) Author: Tomasz Miąsko (tmiasko) Date: 2017-10-25 10:25
Using ndb.ndbm get when key is missing and default value has to be returned
results in invocation of Py_INCREF on null pointer. Test case to reproduce the issue:

```
import dbm.ndbm

with dbm.ndbm.open('db', 'n') as db:
    print(db.get('missing-key'))
```
msg304980 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-10-25 11:58
Could you please create a pull request on GitHub Tomasz?
msg317209 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-05-20 23:20
I forgot about this issue and have fixed this bug in a new issue33383.
History
Date User Action Args
2022-04-11 14:58:53adminsetgithub: 76049
2018-05-20 23:20:54serhiy.storchakasetstatus: open -> closed
superseder: Crash in the get() method a single argument in dbm.ndbm
messages: + msg317209

resolution: duplicate
stage: resolved
2017-10-25 11:58:41serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg304980
2017-10-25 10:25:18tmiaskocreate