View | Details | Raw Unified | Return to bug 64249
Collapse All | Expand All

(-)httpd-2.4/modules/http2/h2_from_h1.c (+27 lines)
Lines 371-376 Link Here
371
                ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, task->c,
371
                ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, task->c,
372
                              "h2_task(%s): read response, incomplete line: %s", 
372
                              "h2_task(%s): read response, incomplete line: %s", 
373
                              task->id, line);
373
                              task->id, line);
374
375
		/* when the parsed string reaches its maximum length, and no
376
                 * linefeed was found, it is impossible to make progress here.
377
                 * Just more data would be queued until the connections closes.
378
		 * So discard the illegal line here.
379
                 */
380
                if ((len+1) == MAX_STRING_LEN) {
381
                        apr_brigade_cleanup(parser->tmp);
382
                        return APR_EINVAL;
383
                }
384
385
                /* need to convert transient buckets to heap buckets here, because
386
                 * the memory pointed to from the transient buckets might got released
387
                 * when get_line() is called again.
388
                 */
389
                apr_bucket *b;
390
                for (b = APR_BRIGADE_FIRST(parser->tmp);
391
                     b != APR_BRIGADE_SENTINEL(parser->tmp);
392
                     b = APR_BUCKET_NEXT(b)) {
393
                     if (APR_BUCKET_IS_TRANSIENT(b)) {
394
                        status = apr_bucket_setaside(b, task->pool); /* convert transient->heap */
395
                        if (status != APR_SUCCESS) {
396
                                apr_brigade_cleanup(parser->tmp);
397
                                return status;
398
                        }
399
                     }
400
                }
374
                return APR_EAGAIN;
401
                return APR_EAGAIN;
375
            }
402
            }
376
        }
403
        }

Return to bug 64249