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 — Forgot to add error check? · Issue #106916 · python/cpython

Forgot to add error check? #106916

New issue
Copy link
New issue
Copy link
Closed
Closed
Forgot to add error check?#106916
Copy link
Assignees
methaneEclips4
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@Eclips4
Eclips4
opened on Jul 20, 2023
Issue body actions

#106411 adds the _PyCompile_CleanDoc function.
there's a call to PyMem_Malloc, but we don't check if it returns NULL value:

cpython/Python/compile.c

Lines 8055 to 8063 in 009e8f0

char *buff = PyMem_Malloc(doc_size);
char *w = buff;
while (p < pend) {
int ch = *w++ = *p++;
if (ch == '\n') {
break;
}
}

Is there a need to check for a NULL value?
If so, I can send a PR.

Linked PRs

  • gh-106916: Add missing error check #106921

Activity

  1. Eclips4
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Jul 20, 2023
  2. Eclips4 commented on Jul 20, 2023

    @Eclips4
    Eclips4
    on Jul 20, 2023
    MemberAuthor
    More actions

    cc @methane

  3. methane commented on Jul 20, 2023

    @methane
    methane
    on Jul 20, 2023
    Member
    More actions

    Yes, I forgot. Thank you.
    Would you create a pull request, or may I?

  4. Eclips4 commented on Jul 20, 2023

    @Eclips4
    Eclips4
    on Jul 20, 2023
    MemberAuthor
    More actions

    I'll soon send a pull request =)

  5. Eclips4
    added a commit that references this issue on Jul 20, 2023

    pythongh-106916: Add missing error check

    618f708
  6. AlexWaygood
    assigned
    methane
    and
    Eclips4
    on Jul 20, 2023
  7. methane
    added a commit that references this issue on Jul 21, 2023

    gh-106916: Add missing error check _PyCompile_CleanDoc (#106921)

    85ed1d2
  8. methane
    closed this as completedon Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @Eclips4
    Eclips4
  • @methane
    methane

Labels

type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

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.