Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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) in the Cython 3.x
# CIntToPyUnicode boilerplate (`__Pyx____Pyx_PyUnicode_From_int`): the destination
# `dpos` is a stack buffer of size `sizeof(int)*3+2`, and `dpos -= 2` immediately
Expand Down
Loading