mirror of https://git.kore.io/kore.git
Do not 0 out everything we allocate, and instead fix the behaviour of the code in the appropriate places.
This commit is contained in:
parent
19a05b0768
commit
341172f844
|
@ -137,7 +137,9 @@ test_base64(u_int8_t *src, u_int32_t slen, struct kore_buf *res)
|
|||
if (!kore_base64_decode(in, &out, &len)) {
|
||||
kore_buf_appendf(res, "decoding failed\n");
|
||||
} else {
|
||||
kore_buf_appendf(res, "decoded: '%s'\n", out);
|
||||
kore_buf_appendf(res, "decoded: ");
|
||||
kore_buf_append(res, out, len);
|
||||
kore_buf_appendf(res, "\n");
|
||||
kore_mem_free(out);
|
||||
}
|
||||
|
||||
|
|
|
@ -316,8 +316,8 @@ http_header_recv(struct netbuf *nb)
|
|||
|
||||
kore_debug("http_header_recv(%p)", nb);
|
||||
|
||||
ch = nb->buf[nb->len - 1];
|
||||
nb->buf[nb->len - 1] = '\0';
|
||||
ch = nb->buf[nb->offset];
|
||||
nb->buf[nb->offset] = '\0';
|
||||
|
||||
if (nb->len < 4)
|
||||
return (KORE_RESULT_OK);
|
||||
|
@ -326,7 +326,8 @@ http_header_recv(struct netbuf *nb)
|
|||
if (strncmp(((char *)end_headers - 2), "\r\n\r\n", 4))
|
||||
return (KORE_RESULT_OK);
|
||||
|
||||
nb->buf[nb->len - 1] = ch;
|
||||
nb->buf[nb->offset] = ch;
|
||||
nb->buf[nb->len - 1] = '\0';
|
||||
nb->flags |= NETBUF_FORCE_REMOVE;
|
||||
end_headers += 2;
|
||||
|
||||
|
|
Loading…
Reference in New Issue