From: Geoff Thorpe Date: Fri, 2 Apr 2004 06:25:30 +0000 (+0000) Subject: Avoid undefined results when the parameter is out of range. X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=22083b182a9b1ad848c20945b8678eff55259be9;p=oweals%2Fopenssl.git Avoid undefined results when the parameter is out of range. --- diff --git a/crypto/stack/stack.c b/crypto/stack/stack.c index 02857f0446..7877b15a4f 100644 --- a/crypto/stack/stack.c +++ b/crypto/stack/stack.c @@ -304,7 +304,7 @@ int sk_num(const STACK *st) char *sk_value(const STACK *st, int i) { - if(st == NULL) return NULL; + if(!st || (i < 0) || (i >= st->num)) return NULL; return st->data[i]; }