modules/proxy/mod_proxy_fcgi.c:512: error: UNINITIALIZED_VALUE
  The value read from header.version was never initialized.

modules/proxy/mod_proxy_fcgi.c:512:17: 
510. 
511.             if (version != AP_FCGI_VERSION_1) {
512.                 ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01068)
                     ^
513.                               "Got bogus version %d", (int) header.version);
514.                 rv = APR_EINVAL;

static apr_status_t dispatch(proxy_conn_rec *conn, proxy_dir_conf *conf,
                             request_rec *r, apr_pool_t *setaside_pool,
                             apr_uint16_t request_id)
{
    apr_bucket_brigade *ib, *ob;
    int seen_end_of_headers = 0, done = 0;
    apr_status_t rv = APR_SUCCESS;
    int script_error_status = HTTP_OK;
    conn_rec *c = r->connection;
    struct iovec vec[2];
    ap_fcgi_header header;
    unsigned char farray[AP_FCGI_HEADER_LEN];
    apr_pollfd_t pfd;
    int header_state = HDR_STATE_READING_HEADERS;
    pfd.desc_type = APR_POLL_SOCKET;
    pfd.desc.s = conn->sock;
    pfd.p = r->pool;
    pfd.reqevents = APR_POLLIN | APR_POLLOUT;
    ib = apr_brigade_create(r->pool, c->bucket_alloc);
    ob = apr_brigade_create(r->pool, c->bucket_alloc);
    while (! done) {
        apr_interval_time_t timeout;
        apr_size_t len;
        int n;
        apr_socket_timeout_get(conn->sock, &timeout);
        rv = apr_poll(&pfd, 1, &n, timeout);
        if (rv != APR_SUCCESS) {
            if (APR_STATUS_IS_EINTR(rv)) {
                continue;
            }
            break;
        }
        if (pfd.rtnevents & APR_POLLOUT) {
            char writebuf[AP_IOBUFSIZE];
            apr_size_t writebuflen;
            int last_stdin = 0;
            int nvec = 0;
            rv = ap_get_brigade(r->input_filters, ib,
                                AP_MODE_READBYTES, APR_BLOCK_READ,
                                sizeof(writebuf));
            if (rv != APR_SUCCESS) {
                break;
            }
            if (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(ib))) {
                last_stdin = 1;
            }
            writebuflen = sizeof(writebuf);
            rv = apr_brigade_flatten(ib, writebuf, &writebuflen);
            apr_brigade_cleanup(ib);
            if (rv != APR_SUCCESS) {
                break;
            }
            ap_fcgi_fill_in_header(&header, AP_FCGI_STDIN, request_id,
                                   (apr_uint16_t) writebuflen, 0);
            ap_fcgi_header_to_array(&header, farray);
            vec[nvec].iov_base = (void *)farray;
            vec[nvec].iov_len = sizeof(farray);
            ++nvec;
            if (writebuflen) {
                vec[nvec].iov_base = writebuf;
                vec[nvec].iov_len = writebuflen;
                ++nvec;
            }
            rv = send_data(conn, vec, nvec, &len, 0);
            if (rv != APR_SUCCESS) {
                break;
            }
            if (last_stdin) {
                pfd.reqevents = APR_POLLIN;
                if (writebuflen) {
                    ap_fcgi_fill_in_header(&header, AP_FCGI_STDIN, request_id,
                                           0, 0);
                    ap_fcgi_header_to_array(&header, farray);
                    vec[0].iov_base = (void *)farray;
                    vec[0].iov_len = sizeof(farray);
                    rv = send_data(conn, vec, 1, &len, 1);
                }
            }
        }
        if (pfd.rtnevents & APR_POLLIN) {
            char readbuf[AP_IOBUFSIZE + 1];
            apr_size_t readbuflen;
            apr_uint16_t clen, rid;
            apr_bucket *b;
            unsigned char plen;
            unsigned char type, version;
            memset(readbuf, 0, sizeof(readbuf));
            memset(farray, 0, sizeof(farray));
            rv = get_data_full(conn, (char *) farray, AP_FCGI_HEADER_LEN);
            if (rv != APR_SUCCESS) {
                ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01067)
                              "Failed to read FastCGI header");
                break;
            }
#ifdef FCGI_DUMP_HEADERS
            ap_log_rdata(APLOG_MARK, APLOG_DEBUG, r, "FastCGI header",
                         farray, AP_FCGI_HEADER_LEN, 0);
#endif
            ap_fcgi_header_fields_from_array(&version, &type, &rid,
                                             &clen, &plen, farray);
            if (version != AP_FCGI_VERSION_1) {
                ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01068)
                              "Got bogus version %d", (int) header.version);
                rv = APR_EINVAL;
                break;
            }
            if (rid != request_id) {
                ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01069)
                              "Got bogus rid %d, expected %d",
                              rid, request_id);
                rv = APR_EINVAL;
                break;
            }
recv_again:
            if (clen > sizeof(readbuf) - 1) {
                readbuflen = sizeof(readbuf) - 1;
            } else {
                readbuflen = clen;
            }
            if (readbuflen != 0) {
                rv = get_data(conn, readbuf, &readbuflen);
                if (rv != APR_SUCCESS) {
                    break;
                }
                readbuf[readbuflen] = 0;
            }
            switch (type) {
            case AP_FCGI_STDOUT:
                if (clen != 0) {
                    b = apr_bucket_transient_create(readbuf,
                                                    readbuflen,
                                                    c->bucket_alloc);
                    APR_BRIGADE_INSERT_TAIL(ob, b);
                    if (! seen_end_of_headers) {
                        int st = handle_headers(r, &header_state, readbuf);
                        if (st == 1) {
                            int status;
                            seen_end_of_headers = 1;
                            status = ap_scan_script_header_err_brigade_ex(r, ob,
                                NULL, APLOG_MODULE_INDEX);
                            if (status != OK) {
                                apr_bucket *tmp_b;
                                apr_brigade_cleanup(ob);
                                tmp_b = apr_bucket_eos_create(c->bucket_alloc);
                                APR_BRIGADE_INSERT_TAIL(ob, tmp_b);
                                r->status = status;
                                ap_pass_brigade(r->output_filters, ob);
                                ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01070)
                                              "Error parsing script headers");
                                rv = APR_EINVAL;
                                break;
                            }
                            if (conf->error_override &&
                                ap_is_HTTP_ERROR(r->status)) {
                                script_error_status = r->status;
                                r->status = HTTP_OK;
                            }
                            if (script_error_status == HTTP_OK) {
                                rv = ap_pass_brigade(r->output_filters, ob);
                                if (rv != APR_SUCCESS) {
                                    break;
                                }
                            }
                            apr_brigade_cleanup(ob);
                            apr_pool_clear(setaside_pool);
                        }
                        else {
                            apr_bucket_setaside(b, setaside_pool);
                        }
                    } else {
                        if (script_error_status == HTTP_OK) {
                            rv = ap_pass_brigade(r->output_filters, ob);
                            if (rv != APR_SUCCESS) {
                                break;
                            }
                        }
                        apr_brigade_cleanup(ob);
                    }
                    if (clen > readbuflen) {
                        clen -= readbuflen;
                        goto recv_again;
                    }
                } else {
                    if (script_error_status == HTTP_OK) {
                        b = apr_bucket_eos_create(c->bucket_alloc);
                        APR_BRIGADE_INSERT_TAIL(ob, b);
                        rv = ap_pass_brigade(r->output_filters, ob);
                        if (rv != APR_SUCCESS) {
                            break;
                        }
                    }
                }
                break;
            case AP_FCGI_STDERR:
                if (clen) {
                    ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01071)
                                  "Got error '%s'", readbuf);
                }
                if (clen > readbuflen) {
                    clen -= readbuflen;
                    goto recv_again;
                }
                break;
            case AP_FCGI_END_REQUEST:
                done = 1;
                break;
            default:
                ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01072)
                              "Got bogus record %d", type);
                break;
            }
            if (plen) {
                rv = get_data_full(conn, readbuf, plen);
                if (rv != APR_SUCCESS) {
                    ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
                                  APLOGNO(02537) "Error occurred reading padding");
                    break;
                }
            }
        }
    }
    apr_brigade_destroy(ib);
    apr_brigade_destroy(ob);
    if (script_error_status != HTTP_OK) {
        ap_die(script_error_status, r);
    }
    return rv;
}
['static apr_status_t dispatch(proxy_conn_rec *conn, proxy_dir_conf *conf,\n                             request_rec *r, apr_pool_t *setaside_pool,\n                             apr_uint16_t request_id)\n{\n    apr_bucket_brigade *ib, *ob;\n    int seen_end_of_headers = 0, done = 0;\n    apr_status_t rv = APR_SUCCESS;\n    int script_error_status = HTTP_OK;\n    conn_rec *c = r->connection;\n    struct iovec vec[2];\n    ap_fcgi_header header;\n    unsigned char farray[AP_FCGI_HEADER_LEN];\n    apr_pollfd_t pfd;\n    int header_state = HDR_STATE_READING_HEADERS;\n    pfd.desc_type = APR_POLL_SOCKET;\n    pfd.desc.s = conn->sock;\n    pfd.p = r->pool;\n    pfd.reqevents = APR_POLLIN | APR_POLLOUT;\n    ib = apr_brigade_create(r->pool, c->bucket_alloc);\n    ob = apr_brigade_create(r->pool, c->bucket_alloc);\n    while (! done) {\n        apr_interval_time_t timeout;\n        apr_size_t len;\n        int n;\n        apr_socket_timeout_get(conn->sock, &timeout);\n        rv = apr_poll(&pfd, 1, &n, timeout);\n        if (rv != APR_SUCCESS) {\n            if (APR_STATUS_IS_EINTR(rv)) {\n                continue;\n            }\n            break;\n        }\n        if (pfd.rtnevents & APR_POLLOUT) {\n            char writebuf[AP_IOBUFSIZE];\n            apr_size_t writebuflen;\n            int last_stdin = 0;\n            int nvec = 0;\n            rv = ap_get_brigade(r->input_filters, ib,\n                                AP_MODE_READBYTES, APR_BLOCK_READ,\n                                sizeof(writebuf));\n            if (rv != APR_SUCCESS) {\n                break;\n            }\n            if (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(ib))) {\n                last_stdin = 1;\n            }\n            writebuflen = sizeof(writebuf);\n            rv = apr_brigade_flatten(ib, writebuf, &writebuflen);\n            apr_brigade_cleanup(ib);\n            if (rv != APR_SUCCESS) {\n                break;\n            }\n            ap_fcgi_fill_in_header(&header, AP_FCGI_STDIN, request_id,\n                                   (apr_uint16_t) writebuflen, 0);\n            ap_fcgi_header_to_array(&header, farray);\n            vec[nvec].iov_base = (void *)farray;\n            vec[nvec].iov_len = sizeof(farray);\n            ++nvec;\n            if (writebuflen) {\n                vec[nvec].iov_base = writebuf;\n                vec[nvec].iov_len = writebuflen;\n                ++nvec;\n            }\n            rv = send_data(conn, vec, nvec, &len, 0);\n            if (rv != APR_SUCCESS) {\n                break;\n            }\n            if (last_stdin) {\n                pfd.reqevents = APR_POLLIN;\n                if (writebuflen) {\n                    ap_fcgi_fill_in_header(&header, AP_FCGI_STDIN, request_id,\n                                           0, 0);\n                    ap_fcgi_header_to_array(&header, farray);\n                    vec[0].iov_base = (void *)farray;\n                    vec[0].iov_len = sizeof(farray);\n                    rv = send_data(conn, vec, 1, &len, 1);\n                }\n            }\n        }\n        if (pfd.rtnevents & APR_POLLIN) {\n            char readbuf[AP_IOBUFSIZE + 1];\n            apr_size_t readbuflen;\n            apr_uint16_t clen, rid;\n            apr_bucket *b;\n            unsigned char plen;\n            unsigned char type, version;\n            memset(readbuf, 0, sizeof(readbuf));\n            memset(farray, 0, sizeof(farray));\n            rv = get_data_full(conn, (char *) farray, AP_FCGI_HEADER_LEN);\n            if (rv != APR_SUCCESS) {\n                ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01067)\n                              "Failed to read FastCGI header");\n                break;\n            }\n#ifdef FCGI_DUMP_HEADERS\n            ap_log_rdata(APLOG_MARK, APLOG_DEBUG, r, "FastCGI header",\n                         farray, AP_FCGI_HEADER_LEN, 0);\n#endif\n            ap_fcgi_header_fields_from_array(&version, &type, &rid,\n                                             &clen, &plen, farray);\n            if (version != AP_FCGI_VERSION_1) {\n                ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01068)\n                              "Got bogus version %d", (int) header.version);\n                rv = APR_EINVAL;\n                break;\n            }\n            if (rid != request_id) {\n                ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01069)\n                              "Got bogus rid %d, expected %d",\n                              rid, request_id);\n                rv = APR_EINVAL;\n                break;\n            }\nrecv_again:\n            if (clen > sizeof(readbuf) - 1) {\n                readbuflen = sizeof(readbuf) - 1;\n            } else {\n                readbuflen = clen;\n            }\n            if (readbuflen != 0) {\n                rv = get_data(conn, readbuf, &readbuflen);\n                if (rv != APR_SUCCESS) {\n                    break;\n                }\n                readbuf[readbuflen] = 0;\n            }\n            switch (type) {\n            case AP_FCGI_STDOUT:\n                if (clen != 0) {\n                    b = apr_bucket_transient_create(readbuf,\n                                                    readbuflen,\n                                                    c->bucket_alloc);\n                    APR_BRIGADE_INSERT_TAIL(ob, b);\n                    if (! seen_end_of_headers) {\n                        int st = handle_headers(r, &header_state, readbuf);\n                        if (st == 1) {\n                            int status;\n                            seen_end_of_headers = 1;\n                            status = ap_scan_script_header_err_brigade_ex(r, ob,\n                                NULL, APLOG_MODULE_INDEX);\n                            if (status != OK) {\n                                apr_bucket *tmp_b;\n                                apr_brigade_cleanup(ob);\n                                tmp_b = apr_bucket_eos_create(c->bucket_alloc);\n                                APR_BRIGADE_INSERT_TAIL(ob, tmp_b);\n                                r->status = status;\n                                ap_pass_brigade(r->output_filters, ob);\n                                ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01070)\n                                              "Error parsing script headers");\n                                rv = APR_EINVAL;\n                                break;\n                            }\n                            if (conf->error_override &&\n                                ap_is_HTTP_ERROR(r->status)) {\n                                script_error_status = r->status;\n                                r->status = HTTP_OK;\n                            }\n                            if (script_error_status == HTTP_OK) {\n                                rv = ap_pass_brigade(r->output_filters, ob);\n                                if (rv != APR_SUCCESS) {\n                                    break;\n                                }\n                            }\n                            apr_brigade_cleanup(ob);\n                            apr_pool_clear(setaside_pool);\n                        }\n                        else {\n                            apr_bucket_setaside(b, setaside_pool);\n                        }\n                    } else {\n                        if (script_error_status == HTTP_OK) {\n                            rv = ap_pass_brigade(r->output_filters, ob);\n                            if (rv != APR_SUCCESS) {\n                                break;\n                            }\n                        }\n                        apr_brigade_cleanup(ob);\n                    }\n                    if (clen > readbuflen) {\n                        clen -= readbuflen;\n                        goto recv_again;\n                    }\n                } else {\n                    if (script_error_status == HTTP_OK) {\n                        b = apr_bucket_eos_create(c->bucket_alloc);\n                        APR_BRIGADE_INSERT_TAIL(ob, b);\n                        rv = ap_pass_brigade(r->output_filters, ob);\n                        if (rv != APR_SUCCESS) {\n                            break;\n                        }\n                    }\n                }\n                break;\n            case AP_FCGI_STDERR:\n                if (clen) {\n                    ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01071)\n                                  "Got error \'%s\'", readbuf);\n                }\n                if (clen > readbuflen) {\n                    clen -= readbuflen;\n                    goto recv_again;\n                }\n                break;\n            case AP_FCGI_END_REQUEST:\n                done = 1;\n                break;\n            default:\n                ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01072)\n                              "Got bogus record %d", type);\n                break;\n            }\n            if (plen) {\n                rv = get_data_full(conn, readbuf, plen);\n                if (rv != APR_SUCCESS) {\n                    ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,\n                                  APLOGNO(02537) "Error occurred reading padding");\n                    break;\n                }\n            }\n        }\n    }\n    apr_brigade_destroy(ib);\n    apr_brigade_destroy(ob);\n    if (script_error_status != HTTP_OK) {\n        ap_die(script_error_status, r);\n    }\n    return rv;\n}']