On Tue, Apr 1, 2014 at 8:00 PM, Yann Ylavic <[email protected]> wrote:
> +static int parse_mime_headers(request_rec *r,
> +                              apr_bucket_brigade *bb,
> +                              apr_read_type_e block,
> +                              ap_filter_t *f, apr_table_t *t,
> +                              int *status, const char **html_notes,
> +                              ap_mime_state_t **state)
>  {
> -    char *last_field = NULL;
> -    apr_size_t last_len = 0;
> -    apr_size_t alloc_len = 0;
>      char *field;
>      char *value;
>      apr_size_t len;
> -    int fields_read = 0;
>      char *tmp_field;
> +    ap_mime_state_t x, *s;
>      core_server_config *conf =
> ap_get_core_module_config(r->server->module_config);
>
> +    if (!state) {
> +        s = &x;
> +        memset(&s, 0, sizeof *s);

Oups, read memset(s, 0, sizeof *s) here.

> +    }
> +    else if (!(s = *state)) {
> +        *state = s = apr_pcalloc(r->pool, sizeof(ap_mime_state_t));
> +    }
> +    else if (s->done) {
> +        return APR_EOF;
> +    }
> +

Reply via email to