Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bed5241

Browse files
stefanormdboom
authored andcommitted
Fix segfault by checking return value from method.apply()
1 parent 1ea3e1f commit bed5241

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/_backend_agg.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,8 @@ GCAgg::_set_hatch_path(const Py::Object& gc)
358358
Py::Object method_obj = gc.getAttr("get_hatch_path");
359359
Py::Callable method(method_obj);
360360
hatchpath = method.apply(Py::Tuple());
361+
if (hatchpath.ptr() == NULL)
362+
throw Py::Exception();
361363
}
362364

363365

0 commit comments

Comments
 (0)