projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
21a0819
)
Rewrite timeout computation in a way that is less prone to overflow.
author
Bodo Möller
<bodo@openssl.org>
Fri, 30 Dec 2005 23:52:20 +0000
(23:52 +0000)
committer
Bodo Möller
<bodo@openssl.org>
Fri, 30 Dec 2005 23:52:20 +0000
(23:52 +0000)
(Problem reported by Peter Sylvester.)
ssl/ssl_sess.c
patch
|
blob
|
history
diff --git
a/ssl/ssl_sess.c
b/ssl/ssl_sess.c
index 5f12aa361c148d8be3b5b8c0f3f9d5dcdc1a1f08..868a207a1f7cfeaca3777fcd32d375e199e0febd 100644
(file)
--- a/
ssl/ssl_sess.c
+++ b/
ssl/ssl_sess.c
@@
-377,7
+377,7
@@
int ssl_get_prev_session(SSL *s, unsigned char *session_id, int len)
CRYPTO_add(&ret->references,1,CRYPTO_LOCK_SSL_SESSION);
#endif
- if (
(long)(ret->time+ret->timeout) < (long)time(NULL
)) /* timeout */
+ if (
ret->timeout < (long)(time(NULL) - ret->time
)) /* timeout */
{
s->ctx->stats.sess_timeout++;
/* remove it from the cache */