Skip to content

Commit e8cf1e0

Browse files
committed
Fix segment fault when iterate all of response headers
1 parent 96d3543 commit e8cf1e0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/c/ngx_http_clojure_mem.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3520,12 +3520,16 @@ static jlong JNICALL jni_ngx_http_clojure_mem_get_headers_items(JNIEnv *env, jcl
35203520
return NGX_ERROR;
35213521
}
35223522
list = &hout->headers;
3523+
3524+
/*content-type is the first header*/
35233525
if (hout->content_type.len) {
35243526
if (i == 0) {
35253527
*pvalue = (uintptr_t)( pvalue + 1 );
35263528
h = (ngx_table_elt_t *)(uintptr_t)*pvalue;
35273529
h->key.data = (u_char*)"Content-Type";
35283530
h->key.len = sizeof("Content-Type") - 1;
3531+
h->value.data = hout->content_type.data;
3532+
h->value.len = hout->content_type.len;
35293533
return 1;
35303534
}
35313535
i--;

0 commit comments

Comments
 (0)