diff options
author | Ralf S. Engelschall <rse@openssl.org> | 1998-12-21 10:56:39 +0000 |
---|---|---|
committer | Ralf S. Engelschall <rse@openssl.org> | 1998-12-21 10:56:39 +0000 |
commit | 58964a492275ca9a59a0cd9c8155cb2491b4b909 (patch) | |
tree | c7b16876a5789463bbbb468ef4829c8129b3d718 /crypto/stack/stack.c | |
parent | d02b48c63a58ea4367a0e905979f140b7d090f86 (diff) |
Import of old SSLeay release: SSLeay 0.9.0b
Diffstat (limited to 'crypto/stack/stack.c')
-rw-r--r-- | crypto/stack/stack.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/crypto/stack/stack.c b/crypto/stack/stack.c index 712089ef31..610ccbb756 100644 --- a/crypto/stack/stack.c +++ b/crypto/stack/stack.c @@ -1,5 +1,5 @@ /* crypto/stack/stack.c */ -/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * * This package is an SSL implementation written @@ -72,7 +72,7 @@ #undef MIN_NODES #define MIN_NODES 4 -char *STACK_version="STACK part of SSLeay 0.8.1b 29-Jun-1998"; +char *STACK_version="STACK part of SSLeay 0.9.0b 29-Jun-1998"; #ifndef NOPROTO #define FP_ICC (int (*)(const void *,const void *)) @@ -193,14 +193,22 @@ STACK *st; int loc; { char *ret; + int i,j; if ((st->num == 0) || (loc < 0) || (loc >= st->num)) return(NULL); ret=st->data[loc]; if (loc != st->num-1) - memcpy( &(st->data[loc]), - &(st->data[loc+1]), - sizeof(char *)*(st->num-loc-1)); + { + j=st->num-1; + for (i=loc; i<j; i++) + st->data[i]=st->data[i+1]; + /* In theory memcpy is not safe for this + * memcpy( &(st->data[loc]), + * &(st->data[loc+1]), + * sizeof(char *)*(st->num-loc-1)); + */ + } st->num--; return(ret); } |