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 doesn't complain if the request contains a null character #65346

Closed
vstinner opened this issue Apr 3, 2014 · 7 comments
Closed

sqlite3 doesn't complain if the request contains a null character #65346

vstinner opened this issue Apr 3, 2014 · 7 comments
Labels
extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error

Comments

@vstinner
Copy link
Member

vstinner commented Apr 3, 2014

BPO 21147
Nosy @vstinner, @serhiy-storchaka
Files
  • sqlite_null.patch
  • sqlite_null_2.patch
  • 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 2014-09-11.18:47:07.108>
    created_at = <Date 2014-04-03.17:07:25.412>
    labels = ['extension-modules', 'type-bug']
    title = "sqlite3 doesn't complain if the request contains a null character"
    updated_at = <Date 2016-12-03.20:01:38.849>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2016-12-03.20:01:38.849>
    actor = 'python-dev'
    assignee = 'none'
    closed = True
    closed_date = <Date 2014-09-11.18:47:07.108>
    closer = 'serhiy.storchaka'
    components = ['Extension Modules']
    creation = <Date 2014-04-03.17:07:25.412>
    creator = 'vstinner'
    dependencies = []
    files = ['34768', '36583']
    hgrepos = []
    issue_num = 21147
    keywords = ['patch']
    message_count = 7.0
    messages = ['215459', '215785', '226416', '226648', '226720', '226760', '282301']
    nosy_count = 4.0
    nosy_names = ['ghaering', 'vstinner', 'python-dev', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue21147'
    versions = ['Python 2.7', 'Python 3.4', 'Python 3.5']

    @vstinner
    Copy link
    Member Author

    vstinner commented Apr 3, 2014

    >>> import sqlite3
    >>> c=sqlite3.connect(":memory:")
    >>> c.execute("select 1")
    <sqlite3.Cursor object at 0x7fd11e6a9110>
    >>> c.execute("select 1").fetchall()
    [(1,)]
    >>> c.execute("\0select 1").fetchall()
    []

    @vstinner
    Copy link
    Member Author

    vstinner commented Apr 9, 2014

    Here is a first patch. I only tested the execute() method.

    @serhiy-storchaka
    Copy link
    Member

    Added a comment on Rietveld.

    @serhiy-storchaka serhiy-storchaka added extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error labels Sep 5, 2014
    @serhiy-storchaka
    Copy link
    Member

    Here is revised patch. There is yet one way to create Statement instance (Connection.__call__) and this patch covers it too.

    @vstinner
    Copy link
    Member Author

    sqlite_null_2.patch looks good to me.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 11, 2014

    New changeset 430865e9ea9f by Serhiy Storchaka in branch '2.7':
    Issue bpo-21147: sqlite3 now raises an exception if the request contains a null
    http://hg.python.org/cpython/rev/430865e9ea9f

    New changeset 517f216d45ea by Serhiy Storchaka in branch '3.4':
    Issue bpo-21147: sqlite3 now raises an exception if the request contains a null
    http://hg.python.org/cpython/rev/517f216d45ea

    New changeset b81f5652c2d7 by Serhiy Storchaka in branch 'default':
    Issue bpo-21147: sqlite3 now raises an exception if the request contains a null
    http://hg.python.org/cpython/rev/b81f5652c2d7

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Dec 3, 2016

    New changeset e358aaf9563f by Benjamin Peterson in branch '2.7':
    fix refleak in null-containing error case (bpo-21147)
    https://hg.python.org/cpython/rev/e358aaf9563f

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants