Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions src/debugpy/_vendored/pydevd/setup_pydevd_cython.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,17 @@ def build_extension(dir_name, extension_name, target_pydevd_name, force_cython,
c_file_contents = c_file_contents.replace(r"_pydevd_bundle\\pydevd_cython.pxd", "_pydevd_bundle/pydevd_cython.pxd")
c_file_contents = c_file_contents.replace(r"_pydevd_bundle\\pydevd_cython.pyx", "_pydevd_bundle/pydevd_cython.pyx")

# Suppress Flawfinder false positive (CWE-120) in the Cython 3.x
# `__Pyx_PyUnicode_Join` boilerplate: the destination `result_uval` was just
# allocated via `PyUnicode_New(result_ulength, max_char)`, and the immediately
# preceding `(PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos` check guards
Comment thread
StellaHuang95 marked this conversation as resolved.
# against char_pos+ulength overflow before the memcpy. The size argument is
# `ulength << kind_shift` which is bounded by the pre-allocated buffer length.
c_file_contents = c_file_contents.replace(
" memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));\n",
" memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift)); /* Flawfinder: ignore */\n",
)

# Suppress Flawfinder false positive (CWE-120/CWE-20) in the
# Cython 3.x ModuleStateLookup boilerplate (`__Pyx_State_ConvertFromInterpIdAsIndex`):
# `read` is a bounded pointer iterator (not POSIX read()), and the loop is
Expand Down
Loading