Skip to content

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

Closed

Description

@vstinner
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']

    Activity

    1. vstinner commented on Apr 3, 2014

      @vstinner
      MemberAuthor
      >>> 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()
      []
    2. vstinner commented on Apr 9, 2014

      @vstinner
      MemberAuthor

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

    3. serhiy-storchaka commented on Sep 5, 2014

      @serhiy-storchaka
      Member

      Added a comment on Rietveld.

    4. serhiy-storchaka commented on Sep 9, 2014

      @serhiy-storchaka
      Member

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

    5. vstinner commented on Sep 10, 2014

      @vstinner
      MemberAuthor

      sqlite_null_2.patch looks good to me.

    6. python-dev commented on Sep 11, 2014

      python-devmannequin
      Mannequin

      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

    7. python-dev commented on Dec 3, 2016

      python-devmannequin
      Mannequin

      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

    8. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      extension-modulesC modules in the Modules dirtype-bugAn unexpected behavior, bug, or error

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions