mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-19 12:51:51 +03:00
fixes improper null-termination in cttp header buffers
This commit is contained in:
parent
95b2c68695
commit
2a10000a67
@ -59,8 +59,8 @@ _cttp_bod_new(c3_w len_w, c3_c* hun_c)
|
|||||||
static u3_hbod*
|
static u3_hbod*
|
||||||
_cttp_bod_from_hed(u3_hhed* hed_u)
|
_cttp_bod_from_hed(u3_hhed* hed_u)
|
||||||
{
|
{
|
||||||
c3_w len_w = hed_u->nam_w + 2 + hed_u->val_w + 3;
|
c3_w len_w = hed_u->nam_w + 2 + hed_u->val_w + 2;
|
||||||
u3_hbod* bod_u = c3_malloc(len_w + sizeof(*bod_u));
|
u3_hbod* bod_u = c3_malloc(1 + len_w + sizeof(*bod_u));
|
||||||
bod_u->hun_y[len_w] = 0;
|
bod_u->hun_y[len_w] = 0;
|
||||||
|
|
||||||
memcpy(bod_u->hun_y, hed_u->nam_c, hed_u->nam_w);
|
memcpy(bod_u->hun_y, hed_u->nam_c, hed_u->nam_w);
|
||||||
|
Loading…
Reference in New Issue
Block a user