From: Ulrich Drepper Date: Tue, 3 Dec 2002 20:06:21 +0000 (+0000) Subject: (get_cached_stack): Don't crash if we first found a stack with a larger size then... X-Git-Tag: cvs/glibc-2_3_2~659 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5cfc88a71854ef17a4a0f3c761d2718fac827329;p=platform%2Fupstream%2Fglibc.git (get_cached_stack): Don't crash if we first found a stack with a larger size then needed. --- diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c index e9e1cfd..9f12f2b 100644 --- a/nptl/allocatestack.c +++ b/nptl/allocatestack.c @@ -114,7 +114,8 @@ get_cached_stack (size_t *sizep, void **memp) break; } - if (result->stackblock_size > curr->stackblock_size) + if (result == NULL + || result->stackblock_size > curr->stackblock_size) result = curr; } }