projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Avoid undefined results when the parameter is out of range.
[openssl.git]
/
crypto
/
stack
/
stack.c
diff --git
a/crypto/stack/stack.c
b/crypto/stack/stack.c
index 1d2b47ee678d3caa25d9275fb5d5247c337ec50a..821b6caca5227ff249b8dc4859e9d4baaa0a3af8 100644
(file)
--- a/
crypto/stack/stack.c
+++ b/
crypto/stack/stack.c
@@
-307,7
+307,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];
}