From d014ea6b5efbfb3d143fc8aacf8bee733cf4c8f0 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 26 Nov 1992 10:30:26 +0000 Subject: * classobject.c: in instance_lenth, test result of call_object for exception before using it. Fixed a few other places where the outcome of calling sq_length wasn't tested for exceptions (bltinmodule.c, ceval.c). --- Python/bltinmodule.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Python/bltinmodule.c') diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index a6e02bed2d..85fd58ecee 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -412,6 +412,8 @@ min_max(v, sign) return NULL; } n = (*sq->sq_length)(v); + if (n < 0) + return NULL; if (n == 0) { err_setstr(ValueError, "min() or max() of empty sequence"); return NULL; -- cgit v1.2.1