The following issues were found
Modules/expat/xmltok_ns.c
1 issues
Line: 92
Column: 3
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
static const ENCODING *
NS(findEncoding)(const ENCODING *enc, const char *ptr, const char *end) {
# define ENCODING_MAX 128
char buf[ENCODING_MAX] = {0};
char *p = buf;
int i;
XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1);
if (ptr != end)
return 0;
Reported by FlawFinder.
Python/_warnings.c
1 issues
Line: 488
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
{
PyObject *f_stderr;
PyObject *name;
char lineno_str[128];
PyOS_snprintf(lineno_str, sizeof(lineno_str), ":%d: ", lineno);
name = _PyObject_GetAttrId(category, &PyId___name__);
if (name == NULL) {
Reported by FlawFinder.
Tools/c-analyzer/c_parser/parser/_delim.py
1 issues
Line: 20
Column: 30
yield result
DELIMITER = textwrap.dedent(rf'''
(
(?:
[^'"()\[\]{};]*
{_ind(STRING_LITERAL, 3)}
}*
Reported by Pylint.
Modules/_io/stringio.c
1 issues
Line: 895
Column: 9
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
PyMem_Free(buf);
return NULL;
}
memcpy(self->buf, buf, bufsize * sizeof(Py_UCS4));
PyMem_Free(buf);
self->string_size = bufsize;
}
/* Set carefully the position value. Alternatively, we could use the seek
Reported by FlawFinder.
Modules/tkappinit.c
1 issues
Line: 38
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
#ifndef MAX_PATH_LEN
#define MAX_PATH_LEN 1024
#endif
char tclLibPath[MAX_PATH_LEN], tkLibPath[MAX_PATH_LEN];
Tcl_Obj* pathPtr;
/* pre- Tcl_Init code copied from tkMacOSXAppInit.c */
Tk_MacOSXOpenBundleResources (interp, "com.tcltk.tcllibrary",
tclLibPath, MAX_PATH_LEN, 0);
Reported by FlawFinder.
Modules/selectmodule.c
1 issues
Line: 1830
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
kqueue_event_repr(kqueue_event_Object *s)
{
char buf[1024];
PyOS_snprintf(
buf, sizeof(buf),
"<select.kevent ident=%zu filter=%d flags=0x%x fflags=0x%x "
"data=0x%llx udata=%p>",
(size_t)(s->e.ident), (int)s->e.filter, (unsigned int)s->e.flags,
Reported by FlawFinder.
Python/Python-ast.c
1 issues
Line: 360
return 1;
};
GENERATE_ASDL_SEQ_CONSTRUCTOR(mod, mod_ty)
GENERATE_ASDL_SEQ_CONSTRUCTOR(stmt, stmt_ty)
GENERATE_ASDL_SEQ_CONSTRUCTOR(expr, expr_ty)
GENERATE_ASDL_SEQ_CONSTRUCTOR(comprehension, comprehension_ty)
GENERATE_ASDL_SEQ_CONSTRUCTOR(excepthandler, excepthandler_ty)
GENERATE_ASDL_SEQ_CONSTRUCTOR(arguments, arguments_ty)
Reported by Cppcheck.
Tools/peg_generator/peg_extension/peg_extension.c
1 issues
Line: 47
Column: 16
CWE codes:
362
goto error;
}
FILE *fp = fopen(filename, "rb");
if (fp == NULL) {
PyErr_SetFromErrnoWithFilename(PyExc_OSError, filename);
goto error;
}
Reported by FlawFinder.
PC/clinic/_msi.c.h
1 issues
Line: 60
Column: 9
CWE codes:
126
if (cabname == NULL) {
goto exit;
}
if (strlen(cabname) != (size_t)cabname_length) {
PyErr_SetString(PyExc_ValueError, "embedded null character");
goto exit;
}
files = args[1];
return_value = _msi_FCICreate_impl(module, cabname, files);
Reported by FlawFinder.
Programs/test_frozenmain.py
1 issues
Line: 1
Column: 1
# Script used to test Py_FrozenMain(): see test_embed.test_frozenmain().
# Run "make regen-test-frozenmain" if you modify this test.
import sys
import _testinternalcapi
print("Frozen Hello World")
print("sys.argv", sys.argv)
config = _testinternalcapi.get_configs()['config']
Reported by Pylint.