Skip to content

Static analysis issues reported by GCC 10 #85347

Closed

Description

@stratakis
mannequin
BPO 41175
Nosy @vstinner, @stratakis, @miss-islington
PRs
  • bpo-41175: Guard against a possible NULL pointer dereference within bytearrayobject #21240
  • [3.9] bpo-41175: Guard against a NULL pointer dereference within bytearrayobject (GH-21240) #21431
  • [3.8] bpo-41175: Guard against a NULL pointer dereference within bytearrayobject (GH-21240) #21432
  • Files
  • debugstaticanalysis.txt
  • 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 = None
    created_at = <Date 2020-06-30.18:06:49.342>
    labels = ['3.8', '3.9', '3.10']
    title = 'Static analysis issues reported by GCC 10'
    updated_at = <Date 2020-07-10.10:18:54.042>
    user = 'https://github.com/stratakis'

    bugs.python.org fields:

    activity = <Date 2020-07-10.10:18:54.042>
    actor = 'miss-islington'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = []
    creation = <Date 2020-06-30.18:06:49.342>
    creator = 'cstratak'
    dependencies = []
    files = ['49281']
    hgrepos = []
    issue_num = 41175
    keywords = ['patch']
    message_count = 5.0
    messages = ['372711', '372713', '373344', '373458', '373459']
    nosy_count = 3.0
    nosy_names = ['vstinner', 'cstratak', 'miss-islington']
    pr_nums = ['21240', '21431', '21432']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue41175'
    versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']

    Activity

    1. stratakis commented on Jun 30, 2020

      stratakismannequin
      MannequinAuthor

      GCC added a static analysis tool recently [0].

      Running it under for CPython code base produces some interesting results.

      Reproducer: ./configure --with-pydebug && CFLAGS='-fanalyzer' make

      Attaching the log.

      [0] https://developers.redhat.com/blog/2020/03/26/static-analysis-in-gcc-10/

    2. stratakis commented on Jun 30, 2020

      stratakismannequin
      MannequinAuthor

      First issue in Objects/bytearrayobject.c [0].

      warning: use of NULL ‘<unknown>’ where non-null expected [CWE-690] [-Wanalyzer-null-argument]
      277 | memcpy(result->ob_bytes, va.buf, va.len);

      [0] https://github.com/python/cpython/blob/master/Objects/bytearrayobject.c#L277

    3. vstinner commented on Jul 8, 2020

      @vstinner
      Member

      New changeset 61fc23c by stratakis in branch 'master':
      bpo-41175: Guard against a NULL pointer dereference within bytearrayobject (GH-21240)
      61fc23c

    4. miss-islington commented on Jul 10, 2020

      @miss-islington
      Contributor

      New changeset 33672c0 by Miss Islington (bot) in branch '3.8':
      bpo-41175: Guard against a NULL pointer dereference within bytearrayobject (GH-21240)
      33672c0

    5. miss-islington commented on Jul 10, 2020

      @miss-islington
      Contributor

      New changeset 51b36ed by Miss Islington (bot) in branch '3.9':
      bpo-41175: Guard against a NULL pointer dereference within bytearrayobject (GH-21240)
      51b36ed

    6. transferred this issue fromon Apr 10, 2022
    7. furkanonder commented on May 12, 2023

      @furkanonder
      Contributor

      @vstinner The issue seems to be solved. Can we close it?

    8. added
      pendingThe issue will be closed if no feedback is provided
      and removed on Sep 28, 2025
    9. added
      type-bugAn unexpected behavior, bug, or error
      interpreter-core(Objects, Python, Grammar, and Parser dirs)
      and removed
      pendingThe issue will be closed if no feedback is provided
      on Sep 28, 2025
    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

      interpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions