genl: Fix size calculation in msg_grow
PATCH 1/1 genl: Fix size calculation in msg_grow
"msg->size - needed" was the opposite of the value we actually need and could end up being negative if we were appending an attribute larger than the current message size.
--- ell/genl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
ell/genl.c +1 -1
@@ -755,7 +755,7 @@ static bool msg_grow(struct l_genl_msg *msg, uint32_t needed)if (msg->size >= msg->len + needed)return true; - grow_by = msg->size - needed; + grow_by = msg->len + needed - msg->size;if (grow_by <32 ) grow_by =128 ;
Signature · 1 line
2.20.1
Denis Kenzior
AppliedHi Andrew,
Quoted 7 lines · Andrew Zaborowski
"
msg->size- needed" was the opposite of the value we actually need and could end up being negative if we were appending an attribute larger than the current message size.--- ell/genl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
applied, thanks.
Regards,
-Denis