Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sqlite3] Handle out-of-memory errors in sqlite3_column_*() #87535

Closed
erlend-aasland opened this issue Mar 2, 2021 · 3 comments
Closed

[sqlite3] Handle out-of-memory errors in sqlite3_column_*() #87535

erlend-aasland opened this issue Mar 2, 2021 · 3 comments
Labels
3.10 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@erlend-aasland
Copy link
Contributor

BPO 43369
Nosy @berkerpeksag, @serhiy-storchaka, @erlend-aasland
PRs
  • bpo-43369: sqlite3_column_text() and sqlite3_column_blob() failures now raise MemoryError #24723
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2021-03-04.09:51:00.030>
    created_at = <Date 2021-03-02.12:37:39.277>
    labels = ['type-bug', 'library', '3.10']
    title = '[sqlite3] Handle out-of-memory errors in sqlite3_column_*()'
    updated_at = <Date 2021-03-04.09:51:00.029>
    user = 'https://github.com/erlend-aasland'

    bugs.python.org fields:

    activity = <Date 2021-03-04.09:51:00.029>
    actor = 'berker.peksag'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-03-04.09:51:00.030>
    closer = 'berker.peksag'
    components = ['Library (Lib)']
    creation = <Date 2021-03-02.12:37:39.277>
    creator = 'erlendaasland'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 43369
    keywords = ['patch']
    message_count = 3.0
    messages = ['387923', '388022', '388080']
    nosy_count = 3.0
    nosy_names = ['berker.peksag', 'serhiy.storchaka', 'erlendaasland']
    pr_nums = ['24723']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue43369'
    versions = ['Python 3.10']

    @erlend-aasland
    Copy link
    Contributor Author

    If sqlite3_column_text() and sqlite3_column_blob() return NULL and sqlite3_errcode() returns SQLITE_NOMEM, we should raise MemoryError and bail.

    @erlend-aasland erlend-aasland added 3.10 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Mar 2, 2021
    @erlend-aasland
    Copy link
    Contributor Author

    Quoting from the SQLite docs:
    "As long as the input parameters are correct, these routines will only fail if an out-of-memory error occurs during a format conversion"

    @berkerpeksag
    Copy link
    Member

    New changeset e161ec5 by Erlend Egeberg Aasland in branch 'master':
    bpo-43369: sqlite3_column_{text,blob} failures now raise MemoryError (GH-24723)
    e161ec5

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.10 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants