mirror of https://gerrit.osmocom.org/libosmocore
msgb: msgb_pull: Abort when pulling more than avail size
Change-Id: I512ff2035ae7a929e6c96df82938cc1ddbcc4e2a
This commit is contained in:
parent
9fa0912e5b
commit
c62fc2d20f
|
@ -331,6 +331,9 @@ static inline void msgb_push_u32(struct msgb *msg, uint32_t word)
|
|||
*/
|
||||
static inline unsigned char *msgb_pull(struct msgb *msgb, unsigned int len)
|
||||
{
|
||||
if (msgb_length(msgb) < len)
|
||||
MSGB_ABORT(msgb, "msgb too small to pull %u (len %u)\n",
|
||||
len, msgb_length(msgb));
|
||||
msgb->len -= len;
|
||||
return msgb->data += len;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue