clang -cc1 -cc1 -triple x86_64-unknown-linux-gnu -analyze -disable-free -disable-llvm-verifier -discard-value-names -main-file-name _imagingtk.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -analyzer-output=html -analyzer-checker=python -analyzer-disable-checker=deadcode -analyzer-config prune-paths=true,suppress-c++-stdlib=true,suppress-null-return-paths=false,crosscheck-with-z3=true,model-path=/opt/pyrefcon/lib/pyrefcon/models/models -analyzer-config experimental-enable-naive-ctu-analysis=true,ctu-dir=/tmp/pyrefcon/Pillow/csa-scan,ctu-index-name=/tmp/pyrefcon/Pillow/csa-scan/externalDefMap.txt,ctu-invocation-list=/tmp/pyrefcon/Pillow/csa-scan/invocations.yaml,display-ctu-progress=false -setup-static-analyzer -analyzer-config-compatibility-mode=true -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=none -fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu x86-64 -tune-cpu generic -debug-info-kind=limited -dwarf-version=4 -debugger-tuning=gdb -fcoverage-compilation-dir=/tmp/pyrefcon/Pillow -resource-dir /opt/pyrefcon/lib/clang/13.0.0 -isystem /opt/pyrefcon/lib/pyrefcon/models/python3.8 -D NDEBUG -D _FORTIFY_SOURCE=2 -I /usr/include/freetype2 -I /usr/include/openjpeg-2.3 -I /tmp/pyrefcon/Pillow -I /usr/include/x86_64-linux-gnu -I /usr/include/fribidi -I /usr/include -internal-isystem /opt/pyrefcon/lib/clang/13.0.0/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/10/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-unused-result -Wsign-compare -Wall -Wformat -Werror=format-security -Wformat -Werror=format-security -Wdate-time -fdebug-compilation-dir=/tmp/pyrefcon/Pillow -ferror-limit 19 -fwrapv -pthread -stack-protector 2 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/pyrefcon/Pillow/csa-scan/reports -x c src/_imagingtk.c
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | #include "Python.h" |
| 16 | #include "libImaging/Imaging.h" |
| 17 | |
| 18 | #include "Tk/_tkmini.h" |
| 19 | |
| 20 | |
| 21 | extern void |
| 22 | TkImaging_Init(Tcl_Interp *interp); |
| 23 | extern int |
| 24 | load_tkinter_funcs(void); |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | typedef struct { |
| 31 | PyObject_HEAD Tcl_Interp *interp; |
| 32 | } TkappObject; |
| 33 | |
| 34 | static PyObject * |
| 35 | _tkinit(PyObject *self, PyObject *args) { |
| 36 | Tcl_Interp *interp; |
| 37 | |
| 38 | PyObject *arg; |
| 39 | int is_interp; |
| 40 | if (!PyArg_ParseTuple(args, "Oi", &arg, &is_interp)) { |
| 41 | return NULL; |
| 42 | } |
| 43 | |
| 44 | if (is_interp) { |
| 45 | interp = (Tcl_Interp *)PyLong_AsVoidPtr(arg); |
| 46 | } else { |
| 47 | TkappObject *app; |
| 48 | |
| 49 | |
| 50 | app = (TkappObject *)PyLong_AsVoidPtr(arg); |
| 51 | interp = app->interp; |
| 52 | } |
| 53 | |
| 54 | |
| 55 | TkImaging_Init(interp); |
| 56 | |
| 57 | Py_INCREF(Py_None); |
| 58 | return Py_None; |
| 59 | } |
| 60 | |
| 61 | static PyMethodDef functions[] = { |
| 62 | |
| 63 | {"tkinit", (PyCFunction)_tkinit, 1}, |
| 64 | {NULL, NULL} |
| 65 | }; |
| 66 | |
| 67 | PyMODINIT_FUNC |
| 68 | PyInit__imagingtk(void) { |
| 69 | static PyModuleDef module_def = { |
| 70 | PyModuleDef_HEAD_INIT, |
| 71 | "_imagingtk", |
| 72 | NULL, |
| 73 | -1, |
| 74 | functions, |
| 75 | }; |
| 76 | PyObject *m; |
| 77 | m = PyModule_Create(&module_def); |
| 1 | Calling 'PyModule_Create2' | |
|
| 3 | | Returning from 'PyModule_Create2' | |
|
| 5 | | PyObject ownership leak with reference count of 1 |
|
| 78 | return (load_tkinter_funcs() == 0) ? m : NULL; |
| |
| 79 | } |