The following issues were found

Modules/_io/clinic/winconsoleio.c.h
1 issues
strlen - Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected)
Security

Line: 80 Column: 13 CWE codes: 126

                      if (mode == NULL) {
            goto exit;
        }
        if (strlen(mode) != (size_t)mode_length) {
            PyErr_SetString(PyExc_ValueError, "embedded null character");
            goto exit;
        }
        if (!--noptargs) {
            goto skip_optional_pos;

            

Reported by FlawFinder.

Objects/iterobject.c
1 issues
Uninitialized variable: seqsize
Error

Line: 95 CWE codes: 908

                      else {
            Py_RETURN_NOTIMPLEMENTED;
        }
        len = seqsize - it->it_index;
        if (len >= 0)
            return PyLong_FromSsize_t(len);
    }
    return PyLong_FromLong(0);
}

            

Reported by Cppcheck.

Modules/_io/clinic/fileio.c.h
1 issues
strlen - Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected)
Security

Line: 81 Column: 13 CWE codes: 126

                      if (mode == NULL) {
            goto exit;
        }
        if (strlen(mode) != (size_t)mode_length) {
            PyErr_SetString(PyExc_ValueError, "embedded null character");
            goto exit;
        }
        if (!--noptargs) {
            goto skip_optional_pos;

            

Reported by FlawFinder.

Modules/binascii.c
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 85 Column: 23 CWE codes: 119 120
Suggestion: Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length

              #define SKIP 0x7E
#define FAIL 0x7D

static const unsigned char table_a2b_hqx[256] = {
/*       ^@    ^A    ^B    ^C    ^D    ^E    ^F    ^G   */
/* 0*/  FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL, FAIL,
/*       \b    \t    \n    ^K    ^L    \r    ^N    ^O   */
/* 1*/  FAIL, FAIL, SKIP, FAIL, FAIL, SKIP, FAIL, FAIL,
/*       ^P    ^Q    ^R    ^S    ^T    ^U    ^V    ^W   */

            

Reported by FlawFinder.

Parser/tokenizer.h
1 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 56 Column: 5 CWE codes: 119 120
Suggestion: Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length

                                         expression (cf. issue 16806) */
    int level;          /* () [] {} Parentheses nesting level */
            /* Used to allow free continuations inside them */
    char parenstack[MAXLEVEL];
    int parenlinenostack[MAXLEVEL];
    int parencolstack[MAXLEVEL];
    PyObject *filename;
    /* Stuff for checking on different tab sizes */
    int altindstack[MAXINDENT];         /* Stack of alternate indents */

            

Reported by FlawFinder.

Tools/c-analyzer/cpython/__init__.py
1 issues
Missing module docstring
Error

Line: 1 Column: 1

              import os.path


TOOL_ROOT = os.path.normcase(
    os.path.abspath(
        os.path.dirname(  # c-analyzer/
            os.path.dirname(__file__))))  # cpython/
REPO_ROOT = (
        os.path.dirname(  # ..

            

Reported by Pylint.

Lib/test/ziptestdata/testdata_module_inside_zip.py
1 issues
Missing module docstring
Error

Line: 1 Column: 1

              # Test data file to be stored within a zip file.
FAVORITE_NUMBER = 5

            

Reported by Pylint.

Objects/genobject.c
1 issues
There is an unknown macro here somewhere. Configuration is required. If _Py_IDENTIFIER is a macro then please configure it.
Error

Line: 407

                         PyObject *typ, PyObject *val, PyObject *tb)
{
    PyObject *yf = _PyGen_yf(gen);
    _Py_IDENTIFIER(throw);

    if (yf) {
        PyObject *ret;
        int err;
        if (PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) &&

            

Reported by Cppcheck.

Lib/traceback.py
1 issues
invalid syntax (<unknown>, line 576)
Error

Line: 576 Column: 12

                      return None

    statement = tree.body[0]
    match statement:
        case ast.Expr(expr):
            match expr:
                case ast.BinOp():
                    operator_str = segment[expr.left.end_col_offset:expr.right.col_offset]
                    operator_offset = len(operator_str) - len(operator_str.lstrip())

            

Reported by Pylint.

Modules/nismodule.c
1 issues
strlen - Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected)
Security

Line: 180 Column: 48 CWE codes: 126

                      return nis_error(state, err);
    }

    res = PyUnicode_FromStringAndSize (domain, strlen(domain));
    return res;
}

static PyObject *
nis_match(PyObject *module, PyObject *args, PyObject *kwdict)

            

Reported by FlawFinder.