The following issues were found

Modules/mathmodule.c
1 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 1375 Column: 17 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                      if (p == ps) {
            v = PyMem_Malloc(sizeof(double) * m);
            if (v != NULL)
                memcpy(v, ps, sizeof(double) * n);
        }
        else
            v = PyMem_Realloc(p, sizeof(double) * m);
    }
    if (v == NULL) {        /* size overflow or no memory */

            

Reported by FlawFinder.

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

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, "div: usage: ./div x y\n");
		exit(1);

            

Reported by FlawFinder.

Tools/freeze/hello.py
1 issues
Missing module docstring
Error

Line: 1 Column: 1

              print('Hello world...')

            

Reported by Pylint.

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

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, "compare: usage: ./compare x y\n");
		exit(1);

            

Reported by FlawFinder.

Objects/clinic/memoryobject.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: 181 Column: 13 CWE codes: 126

                      if (order == NULL) {
            goto exit;
        }
        if (strlen(order) != (size_t)order_length) {
            PyErr_SetString(PyExc_ValueError, "embedded null character");
            goto exit;
        }
    }
    else {

            

Reported by FlawFinder.

Modules/_sqlite/util.c
1 issues
There is an unknown macro here somewhere. Configuration is required. If Py_END_ALLOW_THREADS is a macro then please configure it.
Error

Line: 34

              
    Py_BEGIN_ALLOW_THREADS
    rc = sqlite3_step(statement);
    Py_END_ALLOW_THREADS

    return rc;
}

/**

            

Reported by Cppcheck.

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

Line: 402 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 PyObject *
stat_filemode(PyObject *self, PyObject *omode)
{
    char buf[10];
    mode_t mode;

    mode = _PyLong_AsMode_t(omode);
    if ((mode == (mode_t)-1) && PyErr_Occurred())
        return NULL;

            

Reported by FlawFinder.

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

Line: 28 Column: 17 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

              difficult in the presence of PyCFuncPtrObject.  Maybe later.
*/
union value {
                char c[16];
                short s;
                int i;
                long l;
                float f;
                double d;

            

Reported by FlawFinder.

Python/mysnprintf.c
1 issues
vsnprintf - If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate
Security

Line: 71 Column: 11 CWE codes: 134
Suggestion: Use a constant for the format specification

              #if defined(_MSC_VER)
    len = _vsnprintf(str, size, format, va);
#else
    len = vsnprintf(str, size, format, va);
#endif

Done:
    if (size > 0) {
        str[size-1] = '\0';

            

Reported by FlawFinder.

Python/thread_pthread.h
1 issues
fprintf - If format strings can be influenced by an attacker, they can be exploited
Security

Line: 201 Column: 56 CWE codes: 134
Suggestion: Use a constant for the format specification

              } pthread_lock;

#define CHECK_STATUS(name)  if (status != 0) { perror(name); error = 1; }
#define CHECK_STATUS_PTHREAD(name)  if (status != 0) { fprintf(stderr, \
    "%s: %s\n", name, strerror(status)); error = 1; }

/*
 * Initialization.
 */

            

Reported by FlawFinder.