GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Incorrect use of the C API in getpath_joinpath() · Issue #97758 · python/cpython

Incorrect use of the C API in getpath_joinpath() #97758

New issue
Copy link
New issue
Copy link
Closed
Closed
Incorrect use of the C API in getpath_joinpath()#97758
Copy link
Labels
3.11only security fixesonly security fixes3.12only security fixesonly security fixestype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or errortype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump

Description

@serhiy-storchaka
serhiy-storchaka
opened on Oct 3, 2022
Issue body actions

If the getpath.joinpath() is called without arguments, it tries to return an empty string and calls PyUnicode_FromString(NULL) for this, which causes a crash. The correct way of creating an empty string is PyUnicode_FromStringAndSize(NULL, 0), or PyUnicode_FromString(""), or PyUnicode_FromStringAndSize("", 0).

Alternatively, the function could raise a TypeError instead of returning an empty string.

@zooba @vstinner

Activity

  1. serhiy-storchaka
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    type-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
    on Oct 3, 2022
  2. serhiy-storchaka
    added 2 commits that reference this issue on Oct 3, 2022

    pythongh-97758: Fix a crash in getpath_joinpath() called without argu…

    41a73a4

    gh-97758: Fix a crash in getpath_joinpath() called without arguments (G…

    f8cbd79
  3. miss-islington
    added a commit that references this issue on Oct 5, 2022

    pythongh-97758: Fix a crash in getpath_joinpath() called without argu…

    024bc08
  4. serhiy-storchaka
    closed this as completedon Oct 5, 2022
  5. serhiy-storchaka
    added
    3.11only security fixesonly security fixes
    3.12only security fixesonly security fixes
    on Oct 5, 2022
  6. miss-islington
    added a commit that references this issue on Oct 5, 2022

    gh-97758: Fix a crash in getpath_joinpath() called without arguments (G…

    73e3510
  7. carljm
    added a commit that references this issue on Oct 6, 2022

    Merge branch 'main' into dictwatch

    4bb5d9d
  8. mpage
    added a commit that references this issue on Oct 11, 2022

    pythongh-97758: Fix a crash in getpath_joinpath() called without argu…

    18523e0
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

    3.11only security fixesonly security fixes3.12only security fixesonly security fixestype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or errortype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.