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 — Use of uninitialized pointer in Argument Clinic generated code · Issue #97728 · python/cpython

Use of uninitialized pointer in Argument Clinic generated code #97728

New issue
Copy link
New issue
Copy link
Closed
Closed
Use of uninitialized pointer in Argument Clinic generated code#97728
Copy link
Labels
3.10 (EOL)end of lifeend of life3.11only security fixesonly security fixes3.12only security fixesonly security fixesOS-windowstopic-argument-clinictype-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 2, 2022
Issue body actions

The code generated for the Py_UNICODE converter (and derived converter LPCWSTR) looks like:

const Py_UNICODE *name;
...
if (!_PyArg_ParseXXX(..., name, ...)) {
    goto exit;
}
...
exit:
    PyMem_Free((void *)name);

If parsing fails, PyMem_Free() is called for uninitialized variable.

It is the only converter with non-trivial cleanup which does not have a mandatory initializer.

Activity

  1. serhiy-storchaka
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    needs backport to 3.10
    type-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
    topic-argument-clinic
    needs backport to 3.11only security fixesonly security fixes
    OS-windows
    on Oct 2, 2022
  2. serhiy-storchaka commented on Oct 2, 2022

    @serhiy-storchaka
    serhiy-storchaka
    on Oct 2, 2022
    MemberAuthor
    More actions

    Seems that for now it only affects the Windows code.

    I have found this bug when tried to use Argument Clinic for OS agnostic code which converts arguments to wchar_t * (in getpath.c).

  3. serhiy-storchaka
    added a commit that references this issue on Oct 2, 2022

    pythongh-97728: Argument Clinic: Fix uninitialized variable in the Py…

    96a7768
  4. eryksun commented on Oct 2, 2022

    @eryksun
    eryksun
    on Oct 2, 2022
    Contributor
    More actions

    These needs to be fixed if _winapi.CreateJunction() is used as a fallback for os.symlink() when creating a compatibility link such as "bin -> Scripts". More here: #97586 (comment).

  5. kumaraditya303
    added
    3.11only security fixesonly security fixes
    3.10 (EOL)end of lifeend of life
    3.12only security fixesonly security fixes
    and removed
    needs backport to 3.10
    needs backport to 3.11only security fixesonly security fixes
    on Oct 2, 2022
  6. serhiy-storchaka
    added 5 commits that reference this issue on Oct 3, 2022

    gh-97728: Argument Clinic: Fix uninitialized variable in the Py_UNICO…

    0ee9619

    [3.11] pythongh-97728: Argument Clinic: Fix uninitialized variable in…

    3ca612d

    [3.11] gh-97728: Argument Clinic: Fix uninitialized variable in the P…

    f07ee41

    [3.10] pythongh-97728: Argument Clinic: Fix uninitialized variable in…

    e02ce34

    [3.10] gh-97728: Argument Clinic: Fix uninitialized variable in the P…

    769b9dc
  7. carljm
    added a commit that references this issue on Oct 3, 2022

    Merge branch 'main' into dictwatch

    e83abac
  8. kumaraditya303 commented on Oct 16, 2022

    @kumaraditya303
    kumaraditya303
    on Oct 16, 2022
    Contributor
    More actions

    Fixed by #97729

  9. kumaraditya303
    closed this as completedon Oct 16, 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

    3.10 (EOL)end of lifeend of life3.11only security fixesonly security fixes3.12only security fixesonly security fixesOS-windowstopic-argument-clinictype-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.