From f2610d216059fd2dfced37442ea4e76f0b88a33b Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Mon, 11 Nov 2019 18:04:17 +0300 Subject: Fixing libunit 'off by 2' issue in library. Name and value in each header are 0-terminated, so additional 2 bytes should be allocated for them. There were several attempts to add these 2 bytes to headers in language modules, but some modules weren't updated. Also, adding these 2 bytes is specific to the implementation which may be changed later, so extending this mechanics to modules may cause errors. --- src/go/unit/response.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/go') diff --git a/src/go/unit/response.go b/src/go/unit/response.go index bb326ea5..767d66b7 100644 --- a/src/go/unit/response.go +++ b/src/go/unit/response.go @@ -63,7 +63,7 @@ func (r *response) WriteHeader(code int) { for k, vv := range r.header { for _, v := range vv { fields++ - fields_size += len(k) + len(v) + 2 + fields_size += len(k) + len(v) } } -- cgit