The following issues were found
Modules/_io/clinic/winconsoleio.c.h
1 issues
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
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
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
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
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
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
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
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
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
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.