diff options
author | Rob Austein <sra@hactrn.net> | 2011-11-10 13:00:45 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2011-11-10 13:00:45 +0000 |
commit | 074ad79a18c2c6890246757323d52e4f68f82d4d (patch) | |
tree | e37af17b8dc8db90977bf68b877c55854c4c4497 /rcynic | |
parent | 2640b5c464a73b11ad2f28b33d109278c26151b0 (diff) |
Andrew's torture tests detected a mis-ordering problem in
walk_ctx_loop_init(): need to bump walk state -before- looking for
files not in manifest.
svn path=/trunk/; revision=4079
Diffstat (limited to 'rcynic')
-rw-r--r-- | rcynic/rcynic.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/rcynic/rcynic.c b/rcynic/rcynic.c index 3c7df816..5b780f47 100644 --- a/rcynic/rcynic.c +++ b/rcynic/rcynic.c @@ -1626,17 +1626,16 @@ static void walk_ctx_loop_init(rcynic_ctx_t *rc, STACK_OF(walk_ctx_t) *wsk) if (!w->manifest) logmsg(rc, log_telemetry, "Couldn't get manifest %s, blundering onward", w->certinfo.manifest.s); - assert(w->filenames == NULL); - w->filenames = directory_filenames(rc, w->state, &w->certinfo.sia); - - w->stale_manifest = w->manifest != NULL && X509_cmp_current_time(w->manifest->nextUpdate) < 0; - w->manifest_iteration = 0; w->filename_iteration = 0; w->state++; - assert(w->state == walk_state_current); + assert(w->filenames == NULL); + w->filenames = directory_filenames(rc, w->state, &w->certinfo.sia); + + w->stale_manifest = w->manifest != NULL && X509_cmp_current_time(w->manifest->nextUpdate) < 0; + while (!walk_ctx_loop_done(wsk) && (w->manifest == NULL || w->manifest_iteration >= sk_FileAndHash_num(w->manifest->fileList)) && (w->filenames == NULL || w->filename_iteration >= sk_OPENSSL_STRING_num(w->filenames))) |