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

Static analysis issues reported by GCC 10 #85347

Open
stratakis mannequin opened this issue Jun 30, 2020 · 6 comments
Open

Static analysis issues reported by GCC 10 #85347

stratakis mannequin opened this issue Jun 30, 2020 · 6 comments
Labels
3.8 only security fixes 3.9 only security fixes 3.10 only security fixes

Comments

@stratakis
Copy link
Mannequin

stratakis mannequin commented Jun 30, 2020

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

    @stratakis
    Copy link
    Mannequin Author

    stratakis mannequin commented Jun 30, 2020

    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/

    @stratakis stratakis mannequin added 3.8 only security fixes 3.9 only security fixes 3.10 only security fixes labels Jun 30, 2020
    @stratakis
    Copy link
    Mannequin Author

    stratakis mannequin commented Jun 30, 2020

    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

    @vstinner
    Copy link
    Member

    vstinner commented Jul 8, 2020

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

    @miss-islington
    Copy link
    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

    @miss-islington
    Copy link
    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

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @furkanonder
    Copy link
    Sponsor Contributor

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

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes 3.9 only security fixes 3.10 only security fixes
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants