modules/metadata/mod_remoteip.c:1160: error: UNINITIALIZED_VALUE
  The value read from psts was never initialized.

modules/metadata/mod_remoteip.c:1160:9: 
1158. 
1159.     /* we only get here when done == 1 */
1160.     if (psts == HDR_DONE) {
              ^
1161.         ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, f->c, APLOGNO(03511)
1162.                       "RemoteIPProxyProtocol: received valid PROXY header: %s:%hu",

static apr_status_t remoteip_input_filter(ap_filter_t *f,
                                    apr_bucket_brigade *bb_out,
                                    ap_input_mode_t mode,
                                    apr_read_type_e block,
                                    apr_off_t readbytes)
{
    apr_status_t ret;
    remoteip_filter_context *ctx = f->ctx;
    remoteip_conn_config_t *conn_conf;
    apr_bucket *b;
    remoteip_parse_status_t psts;
    const char *ptr;
    apr_size_t len;
    if (f->c->aborted) {
        return APR_ECONNABORTED;
    }
    if (!ctx) {
        ctx = f->ctx = apr_palloc(f->c->pool, sizeof(*ctx));
        ctx->rcvd = 0;
        ctx->need = MIN_HDR_LEN;
        ctx->version = 0;
        ctx->mode = AP_MODE_READBYTES;
        ctx->bb = apr_brigade_create(f->c->pool, f->c->bucket_alloc);
        ctx->done = 0;
    }
    if (ctx->done) {
        return ap_get_brigade(f->next, bb_out, mode, block, readbytes);
    }
    conn_conf = ap_get_module_config(f->c->conn_config, &remoteip_module);
    while (!ctx->done) {
        if (APR_BRIGADE_EMPTY(ctx->bb)) {
            ret = ap_get_brigade(f->next, ctx->bb, ctx->mode, block,
                                 ctx->need - ctx->rcvd);
            if (ret != APR_SUCCESS) {
                return ret;
            }
        }
        if (APR_BRIGADE_EMPTY(ctx->bb)) {
            return APR_EOF;
        }
        while (!ctx->done && !APR_BRIGADE_EMPTY(ctx->bb)) {
            b = APR_BRIGADE_FIRST(ctx->bb);
            ret = apr_bucket_read(b, &ptr, &len, block);
            if (APR_STATUS_IS_EAGAIN(ret) && block == APR_NONBLOCK_READ) {
                return APR_SUCCESS;
            }
            if (ret != APR_SUCCESS) {
                return ret;
            }
            memcpy(ctx->header + ctx->rcvd, ptr, len);
            ctx->rcvd += len;
            APR_BUCKET_REMOVE(b);
            psts = HDR_NEED_MORE;
            if (ctx->version == 0) {
                if (ctx->rcvd >= MIN_HDR_LEN) {
                    ctx->version = remoteip_determine_version(f->c, ctx->header);
                    if (ctx->version < 0) {
                        psts = HDR_MISSING;
                    }
                    else if (ctx->version == 1) {
                        ctx->mode = AP_MODE_GETLINE;
                        ctx->need = sizeof(proxy_v1);
                    }
                    else if (ctx->version == 2) {
                        ctx->need = MIN_V2_HDR_LEN;
                    }
                }
            }
            else if (ctx->version == 1) {
                psts = remoteip_process_v1_header(f->c, conn_conf,
                                            (proxy_header *) ctx->header,
                                            ctx->rcvd, &ctx->need);
            }
            else if (ctx->version == 2) {
                if (ctx->rcvd >= MIN_V2_HDR_LEN) {
                    ctx->need = MIN_V2_HDR_LEN +
                                ntohs(((proxy_header *) ctx->header)->v2.len);
                }
                if (ctx->rcvd >= ctx->need) {
                    psts = remoteip_process_v2_header(f->c, conn_conf,
                                                (proxy_header *) ctx->header);
                }
            }
            else {
                ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, f->c, APLOGNO(03509)
                              "RemoteIPProxyProtocol: internal error: unknown version "
                              "%d", ctx->version);
                f->c->aborted = 1;
                apr_bucket_delete(b);
                apr_brigade_destroy(ctx->bb);
                return APR_ECONNABORTED;
            }
            switch (psts) {
                case HDR_MISSING:
                    if (conn_conf->proxy_protocol_optional) {
                        ctx->done = 1;
                        APR_BRIGADE_INSERT_HEAD(bb_out, b);
                        return ap_pass_brigade(f->next, ctx->bb);
                    }
                    else {
                        ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, f->c, APLOGNO(03510)
                                     "RemoteIPProxyProtocol: no valid PROXY header found");
                    }
                case HDR_ERROR:
                    f->c->aborted = 1;
                    apr_bucket_delete(b);
                    apr_brigade_destroy(ctx->bb);
                    return APR_ECONNABORTED;
                case HDR_DONE:
                    apr_bucket_delete(b);
                    ctx->done = 1;
                    break;
                case HDR_NEED_MORE:
                    apr_bucket_delete(b);
                    break;
            }
        }
    }
    if (psts == HDR_DONE) {
        ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, f->c, APLOGNO(03511)
                      "RemoteIPProxyProtocol: received valid PROXY header: %s:%hu",
                      conn_conf->client_ip, conn_conf->client_addr->port);
    }
    else {
        ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, f->c, APLOGNO(03512)
                      "RemoteIPProxyProtocol: PROXY header was missing");
    }
    if (ctx->rcvd > ctx->need || !APR_BRIGADE_EMPTY(ctx->bb)) {
        ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, f->c, APLOGNO(03513)
                      "RemoteIPProxyProtocol: internal error: have data left over; "
                      " need=%lu, rcvd=%lu, brigade-empty=%d", ctx->need,
                      ctx->rcvd, APR_BRIGADE_EMPTY(ctx->bb));
        f->c->aborted = 1;
        apr_brigade_destroy(ctx->bb);
        return APR_ECONNABORTED;
    }
    apr_brigade_destroy(ctx->bb);
    ctx->bb = NULL;
    return ap_get_brigade(f->next, bb_out, mode, block, readbytes);
}
['static apr_status_t remoteip_input_filter(ap_filter_t *f,\n                                    apr_bucket_brigade *bb_out,\n                                    ap_input_mode_t mode,\n                                    apr_read_type_e block,\n                                    apr_off_t readbytes)\n{\n    apr_status_t ret;\n    remoteip_filter_context *ctx = f->ctx;\n    remoteip_conn_config_t *conn_conf;\n    apr_bucket *b;\n    remoteip_parse_status_t psts;\n    const char *ptr;\n    apr_size_t len;\n    if (f->c->aborted) {\n        return APR_ECONNABORTED;\n    }\n    if (!ctx) {\n        ctx = f->ctx = apr_palloc(f->c->pool, sizeof(*ctx));\n        ctx->rcvd = 0;\n        ctx->need = MIN_HDR_LEN;\n        ctx->version = 0;\n        ctx->mode = AP_MODE_READBYTES;\n        ctx->bb = apr_brigade_create(f->c->pool, f->c->bucket_alloc);\n        ctx->done = 0;\n    }\n    if (ctx->done) {\n        return ap_get_brigade(f->next, bb_out, mode, block, readbytes);\n    }\n    conn_conf = ap_get_module_config(f->c->conn_config, &remoteip_module);\n    while (!ctx->done) {\n        if (APR_BRIGADE_EMPTY(ctx->bb)) {\n            ret = ap_get_brigade(f->next, ctx->bb, ctx->mode, block,\n                                 ctx->need - ctx->rcvd);\n            if (ret != APR_SUCCESS) {\n                return ret;\n            }\n        }\n        if (APR_BRIGADE_EMPTY(ctx->bb)) {\n            return APR_EOF;\n        }\n        while (!ctx->done && !APR_BRIGADE_EMPTY(ctx->bb)) {\n            b = APR_BRIGADE_FIRST(ctx->bb);\n            ret = apr_bucket_read(b, &ptr, &len, block);\n            if (APR_STATUS_IS_EAGAIN(ret) && block == APR_NONBLOCK_READ) {\n                return APR_SUCCESS;\n            }\n            if (ret != APR_SUCCESS) {\n                return ret;\n            }\n            memcpy(ctx->header + ctx->rcvd, ptr, len);\n            ctx->rcvd += len;\n            APR_BUCKET_REMOVE(b);\n            psts = HDR_NEED_MORE;\n            if (ctx->version == 0) {\n                if (ctx->rcvd >= MIN_HDR_LEN) {\n                    ctx->version = remoteip_determine_version(f->c, ctx->header);\n                    if (ctx->version < 0) {\n                        psts = HDR_MISSING;\n                    }\n                    else if (ctx->version == 1) {\n                        ctx->mode = AP_MODE_GETLINE;\n                        ctx->need = sizeof(proxy_v1);\n                    }\n                    else if (ctx->version == 2) {\n                        ctx->need = MIN_V2_HDR_LEN;\n                    }\n                }\n            }\n            else if (ctx->version == 1) {\n                psts = remoteip_process_v1_header(f->c, conn_conf,\n                                            (proxy_header *) ctx->header,\n                                            ctx->rcvd, &ctx->need);\n            }\n            else if (ctx->version == 2) {\n                if (ctx->rcvd >= MIN_V2_HDR_LEN) {\n                    ctx->need = MIN_V2_HDR_LEN +\n                                ntohs(((proxy_header *) ctx->header)->v2.len);\n                }\n                if (ctx->rcvd >= ctx->need) {\n                    psts = remoteip_process_v2_header(f->c, conn_conf,\n                                                (proxy_header *) ctx->header);\n                }\n            }\n            else {\n                ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, f->c, APLOGNO(03509)\n                              "RemoteIPProxyProtocol: internal error: unknown version "\n                              "%d", ctx->version);\n                f->c->aborted = 1;\n                apr_bucket_delete(b);\n                apr_brigade_destroy(ctx->bb);\n                return APR_ECONNABORTED;\n            }\n            switch (psts) {\n                case HDR_MISSING:\n                    if (conn_conf->proxy_protocol_optional) {\n                        ctx->done = 1;\n                        APR_BRIGADE_INSERT_HEAD(bb_out, b);\n                        return ap_pass_brigade(f->next, ctx->bb);\n                    }\n                    else {\n                        ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, f->c, APLOGNO(03510)\n                                     "RemoteIPProxyProtocol: no valid PROXY header found");\n                    }\n                case HDR_ERROR:\n                    f->c->aborted = 1;\n                    apr_bucket_delete(b);\n                    apr_brigade_destroy(ctx->bb);\n                    return APR_ECONNABORTED;\n                case HDR_DONE:\n                    apr_bucket_delete(b);\n                    ctx->done = 1;\n                    break;\n                case HDR_NEED_MORE:\n                    apr_bucket_delete(b);\n                    break;\n            }\n        }\n    }\n    if (psts == HDR_DONE) {\n        ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, f->c, APLOGNO(03511)\n                      "RemoteIPProxyProtocol: received valid PROXY header: %s:%hu",\n                      conn_conf->client_ip, conn_conf->client_addr->port);\n    }\n    else {\n        ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, f->c, APLOGNO(03512)\n                      "RemoteIPProxyProtocol: PROXY header was missing");\n    }\n    if (ctx->rcvd > ctx->need || !APR_BRIGADE_EMPTY(ctx->bb)) {\n        ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, f->c, APLOGNO(03513)\n                      "RemoteIPProxyProtocol: internal error: have data left over; "\n                      " need=%lu, rcvd=%lu, brigade-empty=%d", ctx->need,\n                      ctx->rcvd, APR_BRIGADE_EMPTY(ctx->bb));\n        f->c->aborted = 1;\n        apr_brigade_destroy(ctx->bb);\n        return APR_ECONNABORTED;\n    }\n    apr_brigade_destroy(ctx->bb);\n    ctx->bb = NULL;\n    return ap_get_brigade(f->next, bb_out, mode, block, readbytes);\n}']