]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
fix time-of-use vs time-of-check
authorRuediger Pluem <rpluem@apache.org>
Tue, 14 Sep 2021 06:56:21 +0000 (06:56 +0000)
committerRuediger Pluem <rpluem@apache.org>
Tue, 14 Sep 2021 06:56:21 +0000 (06:56 +0000)
fix time-of-use time-of-check bugs

Submitted by: kokke <spam@rowdy.dk>

Github: closes #266

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893326 13f79535-47bb-0310-9956-ffa450edef68

modules/http2/h2_from_h1.c
modules/md/md_acme.c

index 16a549a89735cf5a25533fa77282f62941130df0..86e63286176f4a1b9e1970e6c4522610a12fee4c 100644 (file)
@@ -232,7 +232,7 @@ static h2_headers *create_response(h2_task *task, request_rec *r)
     if (r->proxyreq != PROXYREQ_RESPONSE
             || !apr_table_get(r->headers_out, "Date")) {
         char *date = apr_palloc(r->pool, APR_RFC822_DATE_LEN);
-        ap_recent_rfc822_date(date, r? r->request_time : apr_time_now());
+        ap_recent_rfc822_date(date, r->request_time);
         apr_table_setn(r->headers_out, "Date", date );
     }
     if (r->proxyreq != PROXYREQ_RESPONSE) {
index 82e16125a4c59211cc92ecba4c8cc1dd692a05ea..80a76fb63deff7432ba733ea7dcd9482ed5ac67a 100644 (file)
@@ -388,10 +388,10 @@ static apr_status_t md_acme_req_send(md_acme_req_t *req)
     
     if (req->req_json) {
         body = apr_pcalloc(req->p, sizeof(*body));
-        body->data = md_json_writep(req->req_json, req->p, MD_JSON_FMT_INDENT);
         if (!body) {
             rv = APR_EINVAL; goto leave;
         }
+        body->data = md_json_writep(req->req_json, req->p, MD_JSON_FMT_INDENT);
         body->len = strlen(body->data);
     }