Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit742463e

Browse files
DanBarzilianlostmsu
authored andcommitted
Increase ob's ref count in tp_repr to avoid accidental free
1 parent9fb545a commit742463e

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

‎AUTHORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,5 @@
7373
- ([@rmadsen-ks](https://github.com/rmadsen-ks))
7474
- ([@stonebig](https://github.com/stonebig))
7575
- ([@testrunner123](https://github.com/testrunner123))
76+
- ([@DanBarzilian](https://github.com/DanBarzilian))
7677

‎CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].
1313

1414
###Fixed
1515

16+
- Fix incorrect dereference of wrapper object in tp_repr, which may result in a program crash
17+
1618
##[2.5.0][] - 2020-06-14
1719

1820
This version improves performance on benchmarks significantly compared to 2.3.

‎src/runtime/classbase.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ public static IntPtr tp_repr(IntPtr ob)
266266

267267
//otherwise use the standard object.__repr__(inst)
268268
IntPtrargs=Runtime.PyTuple_New(1);
269+
Runtime.XIncref(ob);
269270
Runtime.PyTuple_SetItem(args,0,ob);
270271
IntPtrreprFunc=Runtime.PyObject_GetAttrString(Runtime.PyBaseObjectType,"__repr__");
271272
varoutput=Runtime.PyObject_Call(reprFunc,args,IntPtr.Zero);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp