The following issues were found
Modules/clinic/_elementtree.c.h
1 issues
Line: 835
Column: 13
CWE codes:
126
if (encoding == NULL) {
goto exit;
}
if (strlen(encoding) != (size_t)encoding_length) {
PyErr_SetString(PyExc_ValueError, "embedded null character");
goto exit;
}
}
else {
Reported by FlawFinder.
Modules/_decimal/libmpdec/examples/powmod.c
1 issues
Line: 42
Column: 2
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
mpd_t *a, *b, *c;
mpd_t *result;
char *rstring;
char status_str[MPD_MAX_FLAG_STRING];
clock_t start_clock, end_clock;
if (argc != 4) {
fprintf(stderr, "powmod: usage: ./powmod x y z\n");
exit(1);
Reported by FlawFinder.
Modules/gcmodule.c
1 issues
Line: 1054
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
static void
show_stats_each_generations(GCState *gcstate)
{
char buf[100];
size_t pos = 0;
for (int i = 0; i < NUM_GENERATIONS && pos < sizeof(buf); i++) {
pos += PyOS_snprintf(buf+pos, sizeof(buf)-pos,
" %zd",
Reported by FlawFinder.
Modules/_decimal/libmpdec/examples/pow.c
1 issues
Line: 42
Column: 2
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
mpd_t *a, *b;
mpd_t *result;
char *rstring;
char status_str[MPD_MAX_FLAG_STRING];
clock_t start_clock, end_clock;
if (argc != 3) {
fprintf(stderr, "pow: usage: ./pow x y\n");
exit(1);
Reported by FlawFinder.
Modules/getbuildinfo.c
1 issues
Line: 37
Column: 12
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
const char *
Py_GetBuildInfo(void)
{
static char buildinfo[50 + sizeof(GITVERSION) +
((sizeof(GITTAG) > sizeof(GITBRANCH)) ?
sizeof(GITTAG) : sizeof(GITBRANCH))];
const char *revision = _Py_gitversion();
const char *sep = *revision ? ":" : "";
const char *gitid = _Py_gitidentifier();
Reported by FlawFinder.
Modules/clinic/_gdbmmodule.c.h
1 issues
Line: 326
Column: 9
CWE codes:
126
if (flags == NULL) {
goto exit;
}
if (strlen(flags) != (size_t)flags_length) {
PyErr_SetString(PyExc_ValueError, "embedded null character");
goto exit;
}
if (nargs < 3) {
goto skip_optional;
Reported by FlawFinder.
Modules/_decimal/libmpdec/examples/multiply.c
1 issues
Line: 42
Column: 2
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
mpd_t *a, *b;
mpd_t *result;
char *rstring;
char status_str[MPD_MAX_FLAG_STRING];
clock_t start_clock, end_clock;
if (argc != 3) {
fprintf(stderr, "multiply: usage: ./multiply x y\n");
exit(1);
Reported by FlawFinder.
Modules/_decimal/libmpdec/examples/divmod.c
1 issues
Line: 42
Column: 2
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
mpd_t *a, *b;
mpd_t *q, *r;
char *qs, *rs;
char status_str[MPD_MAX_FLAG_STRING];
clock_t start_clock, end_clock;
if (argc != 3) {
fprintf(stderr, "divmod: usage: ./divmod x y\n");
exit(1);
Reported by FlawFinder.
Modules/clinic/_hashopenssl.c.h
1 issues
Line: 911
Column: 9
CWE codes:
126
if (hash_name == NULL) {
goto exit;
}
if (strlen(hash_name) != (size_t)hash_name_length) {
PyErr_SetString(PyExc_ValueError, "embedded null character");
goto exit;
}
if (PyObject_GetBuffer(args[1], &password, PyBUF_SIMPLE) != 0) {
goto exit;
Reported by FlawFinder.
Lib/tkinter/constants.py
1 issues
Line: 1
Column: 1
# Symbolic constants for Tk
# Booleans
NO=FALSE=OFF=0
YES=TRUE=ON=1
# -anchor and -sticky
N='n'
S='s'
Reported by Pylint.