[New-bugs-announce] [issue22035] Fatal error in dbm.gdbm

Serhiy Storchaka report at bugs.python.org
Tue Jul 22 12:20:40 CEST 2014


New submission from Serhiy Storchaka:

It is possible to crash Python by breaking opened gdbm database.

>>> import _gdbm as dbm
>>> db = dbm.open('x.db', 'n')
>>> open('x.db', 'wb').close()
>>> db[b'a'] = b'b'
gdbm fatal: read error

Proposed patch tries to convert fatal gdbm into regular exception or in Python fatal error (which at least produces traceback).

>>> import _gdbm as dbm
>>> db = dbm.open('x.db', 'n')
>>> open('x.db', 'wb').close()
>>> db[b'a'] = b'b'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
_gdbm.error: gdbm fatal: read error

----------
components: Extension Modules
files: dbm_gdbm_fatal_error.patch
keywords: patch
messages: 223658
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Fatal error in dbm.gdbm
type: crash
versions: Python 2.7, Python 3.4, Python 3.5
Added file: http://bugs.python.org/file36031/dbm_gdbm_fatal_error.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22035>
_______________________________________


More information about the New-bugs-announce mailing list