You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// This counts on message bodies being aligned sensibly.
msg=*(nng_msg**) (((char*) ptr) -sizeof(msg));
// We need to realloc the requested len, plus size for our header.
if ((rv=nng_msg_realloc(msg, len+sizeof(msg))) !=0) {
// We don't free the old message. Code is free to cope
// as it sees fit.
nn_seterror(rv);
return (NULL);
}
// Stash the msg header pointer
*(nng_msg**) (nng_msg_body(msg)) =msg;
nng_msg_trim(msg, sizeof(msg));
return (nng_msg_body(msg));
In this code nng_msg_realloc copies message without trimmed nng_msg* in the beginning.
Then we overwrite first 8 message bytes with nng_msg*, and trim them, so on realloc we are actually removing first 8 bytes of message.
The text was updated successfully, but these errors were encountered:
nng/src/compat/nanomsg/nn.c
Lines 366 to 379 in a54820f
In this code nng_msg_realloc copies message without trimmed nng_msg* in the beginning.
Then we overwrite first 8 message bytes with nng_msg*, and trim them, so on realloc we are actually removing first 8 bytes of message.
The text was updated successfully, but these errors were encountered: