diff options
author | Jim Jagielski <jim@apache.org> | 2003-09-10 16:21:12 +0200 |
---|---|---|
committer | Jim Jagielski <jim@apache.org> | 2003-09-10 16:21:12 +0200 |
commit | a2c6b81c2878ba5fbec0ad6fc57b8e92a03a89a2 (patch) | |
tree | c9ec0d56c3a69b88499a67a28d077710f541c435 /modules/ssl | |
parent | zap an incorrect comment that remained from 1.3 days (diff) | |
download | apache2-a2c6b81c2878ba5fbec0ad6fc57b8e92a03a89a2.tar.xz apache2-a2c6b81c2878ba5fbec0ad6fc57b8e92a03a89a2.zip |
These silent errors have bitten me a few times, now that we
use APR'd dbm. mod_ssl had hacked sdbm for larger sizes.
PR:
Obtained from:
Submitted by:
Reviewed by:
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101214 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/ssl')
-rw-r--r-- | modules/ssl/ssl_scache_dbm.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/modules/ssl/ssl_scache_dbm.c b/modules/ssl/ssl_scache_dbm.c index abcfa8d1c2..6ec20037c2 100644 --- a/modules/ssl/ssl_scache_dbm.c +++ b/modules/ssl/ssl_scache_dbm.c @@ -145,18 +145,30 @@ BOOL ssl_scache_dbm_store(server_rec *s, UCHAR *id, int idlen, time_t expiry, SS apr_status_t rv; /* streamline session data */ - if ((nData = i2d_SSL_SESSION(sess, NULL)) > sizeof(ucaData)) + if ((nData = i2d_SSL_SESSION(sess, NULL)) > sizeof(ucaData)) { + ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, + "streamline session data size too large: %d > %d", + nData, sizeof(ucaData)); return FALSE; + } ucp = ucaData; i2d_SSL_SESSION(sess, &ucp); /* be careful: do not try to store too much bytes in a DBM file! */ #ifdef PAIRMAX - if ((idlen + nData) >= PAIRMAX) + if ((idlen + nData) >= PAIRMAX) { + ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, + "data size too large for DBM session cache: %d >= %d", + (idlen + nData), PAIRMAX); return FALSE; + } #else - if ((idlen + nData) >= 950 /* at least less than approx. 1KB */) + if ((idlen + nData) >= 950 /* at least less than approx. 1KB */) { + ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, + "data size too large for DBM session cache: %d >= %d", + (idlen + nData), 950); return FALSE; + } #endif /* create DBM key */ @@ -166,8 +178,11 @@ BOOL ssl_scache_dbm_store(server_rec *s, UCHAR *id, int idlen, time_t expiry, SS /* create DBM value */ dbmval.dsize = sizeof(time_t) + nData; dbmval.dptr = (char *)malloc(dbmval.dsize); - if (dbmval.dptr == NULL) + if (dbmval.dptr == NULL) { + ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, + "malloc error creating DBM value"); return FALSE; + } memcpy((char *)dbmval.dptr, &expiry, sizeof(time_t)); memcpy((char *)dbmval.dptr+sizeof(time_t), ucaData, nData); |