The function dessert_meshsend performs a consistent check via dessert_msg_check. Here, the function checks if the size of the header and the payload length are less than the supposed length (as passed to the function). While the function performs a ntohs on the length fields, the dessert_meshsend function doesn't. The ad hoc fix would be to change the following code from
/* check message - we only send valid messages! */
if(dessert_msg_check(msgin, msgin->hlen + msgin->plen)) {
dessert_warn("will not send invalid message - aborting");
return EINVAL;
}
to
/* check message - we only send valid messages! */
if(dessert_msg_check(msgin, ntohs(msgin->hlen) + ntohs(msgin->plen))) {
dessert_warn("will not send invalid message - aborting");
return EINVAL;
}
However, we should check if this acutally breaks things.
The function dessert_meshsend performs a consistent check via dessert_msg_check. Here, the function checks if the size of the header and the payload length are less than the supposed length (as passed to the function). While the function performs a
ntohson the length fields, thedessert_meshsendfunction doesn't. The ad hoc fix would be to change the following code fromto
However, we should check if this acutally breaks things.