PyUnstable_Eval_RequestCodeExtraIndex freefunc may be called with a null pointer
未關閉
還沒有人認領這個 Issue。
type-bug
- 主要語言
- Python
- 星號
- 77.2k
- 分支
- 36k
- PR 合併指標
- PR 指標待擷取
描述
Bug report
Bug description:
The PyUnstable_Code_SetExtra path checks for the previous value being null but code_dealloc does not.
This can lead to freefunc being called with null either through the extra value being explicitly set to null or through a value being set on an extra value with a later index, without a value being set on an earlier index.
This doesn't match the documentation, which says that freefunc is not called for null values.
CPython versions tested on:
3.11, CPython main branch
Operating systems tested on:
Linux
Linked PRs
- gh-122492
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
從 Objects/codeobject.c 中的 PyUnstable_Code_SetExtra 檢查以及報告中連結的 code_dealloc 路徑開始。將這兩條路徑與文件中說明的 null 值行為進行比較,然後檢查已連結的 PR gh-122492,了解已經在進行的工作及其驗證方法。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- c, python
- 領域
- backend
- Issue 類型
- 缺陷
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 描述清楚
- 新手友好度
- 20/100