Skip to content
Snippets Groups Projects
Commit 52b90320 authored by Steven Murray's avatar Steven Murray
Browse files

Due to all of the code reductions I have made recently, I have added a

paranoid assertion to the legacy marshalling code that fires if the number of
bytes marshalled does not match the calculated message length.
parent 9664124b
Branches
Tags
No related merge requests found
......@@ -351,6 +351,21 @@ static int rtcp_Transfer(int *s,
len = 0;
rtcp_log(LOG_DEBUG,"rtcp_Transfer(): send bodyless message\n");
}
{
const int sizeOfMsgHeader = 12;
const int totalMsgLen = sizeOfMsgHeader + len;
const int nbBytesMarshalled = p - hdrbuf;
if(nbBytesMarshalled != totalMsgLen) {
rtcp_log(LOG_ERR,
"rtcp_Transfer(): length mismatch:"
" reqtype=0x%x nbBytesMarshalled=%d totalMsgLen=%d\n",
reqtype, nbBytesMarshalled, totalMsgLen);
errno = SEINTERNAL;
serrno = SEINTERNAL;;
return(-1);
}
}
p = hdrbuf;
DO_MARSHALL(LONG,p,magic,whereto);
DO_MARSHALL(LONG,p,reqtype,whereto);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment