From 22083b182a9b1ad848c20945b8678eff55259be9 Mon Sep 17 00:00:00 2001 From: Geoff Thorpe Date: Fri, 2 Apr 2004 06:25:30 +0000 Subject: [PATCH] Avoid undefined results when the parameter is out of range. --- crypto/stack/stack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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]; } -- 2.25.1