You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by yl...@apache.org on 2018/05/20 12:19:13 UTC
svn commit: r1831935 - /httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c
Author: ylavic
Date: Sun May 20 12:19:13 2018
New Revision: 1831935
URL: http://svn.apache.org/viewvc?rev=1831935&view=rev
Log:
mod_slotmem_shm: follow up to r1831869: fix persisted file size's checksum.
Modified:
httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c
Modified: httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c?rev=1831935&r1=1831934&r2=1831935&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c (original)
+++ httpd/httpd/trunk/modules/slotmem/mod_slotmem_shm.c Sun May 20 12:19:13 2018
@@ -200,7 +200,7 @@ static apr_status_t restore_slotmem(shar
apr_file_t *fp;
apr_status_t rv = APR_ENOTIMPL;
void *ptr = (char *)desc + AP_SLOTMEM_OFFSET;
- apr_size_t dsize = size - AP_SLOTMEM_OFFSET;
+ apr_size_t nbytes = size - AP_SLOTMEM_OFFSET;
unsigned char digest[APR_MD5_DIGESTSIZE];
unsigned char digest2[APR_MD5_DIGESTSIZE];
char desc_buf[AP_SLOTMEM_OFFSET];
@@ -212,7 +212,7 @@ static apr_status_t restore_slotmem(shar
rv = apr_file_open(&fp, storename, APR_READ | APR_WRITE, APR_OS_DEFAULT,
pool);
if (rv == APR_SUCCESS) {
- rv = apr_file_read_full(fp, ptr, dsize, NULL);
+ rv = apr_file_read_full(fp, ptr, nbytes, NULL);
if (rv == APR_SUCCESS || rv == APR_EOF) {
rv = APR_SUCCESS; /* for successful return @ EOF */
/*
@@ -222,7 +222,7 @@ static apr_status_t restore_slotmem(shar
if (apr_file_eof(fp) != APR_EOF) {
rv = apr_file_read_full(fp, digest, APR_MD5_DIGESTSIZE, NULL);
if (rv == APR_SUCCESS || rv == APR_EOF) {
- apr_md5(digest2, ptr, APR_MD5_DIGESTSIZE);
+ apr_md5(digest2, ptr, nbytes);
if (memcmp(digest, digest2, APR_MD5_DIGESTSIZE)) {
rv = APR_EMISMATCH;
}