Skip to content

consistency check in dessert_meshsend #4

@mfrey

Description

@mfrey

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions