File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
graalpython/lib-graalpython/patches/zstandard Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change
1
+ [[rules ]]
2
+ patch = ' zstandard.patch'
Original file line number Diff line number Diff line change
1
+ diff --git a/c-ext/backend_c.c b/c-ext/backend_c.c
2
+ index 6edcd52..12ee7c1 100644
3
+ --- a/c-ext/backend_c.c
4
+ +++ b/c-ext/backend_c.c
5
+ @@ -313,7 +313,12 @@ size_t roundpow2(size_t i) {
6
+ int safe_pybytes_resize(PyObject **obj, Py_ssize_t size) {
7
+ PyObject *tmp;
8
+
9
+ - if (Py_REFCNT((*obj)) == 1) {
10
+ + /*
11
+ + * GraalPy change: we don't want to randomly fall through to the code
12
+ + * below, because it doesn't handle all cases (shrinking) and causes memory
13
+ + * corruption
14
+ + */
15
+ + if (/* Py_REFCNT((*obj)) == 1 */ 1) {
16
+ return _PyBytes_Resize(obj, size);
17
+ }
18
+
You can’t perform that action at this time.
0 commit comments