From 21eccb2e9f94fa591aa04d910ab9990121e9db40 Mon Sep 17 00:00:00 2001 From: alobbs Date: Sat, 29 Aug 2009 09:18:06 +0000 Subject: [PATCH] Fixes a potential issue. There was corner situation on which I/O cache could read a couple of uninitialized bytes of memory while turning 'File not found' error codes. git-svn-id: svn://cherokee-project.com/cherokee/trunk@3602 5dc97367-97f1-0310-9951-d761b3857238 --- cherokee/iocache.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cherokee/iocache.c b/cherokee/iocache.c index 4c11f659c..720788cc8 100644 --- a/cherokee/iocache.c +++ b/cherokee/iocache.c @@ -265,6 +265,12 @@ ioentry_update_stat (cherokee_iocache_entry_t *entry) if (PRIV(entry)->stat_expiration >= cherokee_bogonow_now) { TRACE (ENTRIES, "Update stat: %s: updated - skipped\n", CACHE_ENTRY(entry)->key.buf); + + /* Checked, but file didn't exist */ + if (PUBL(entry)->state_ret != ret_ok) { + return ret_deny; + } + return ret_ok_and_sent; }