pespin has uploaded this change for review.

View Change

osmo_io: Assert osmo_iofd_set_alloc_info() params fit in a 16bit value

Related: SYS#7842
Change-Id: I32822574db8997a02bf18b71bf6ab596e726cb82
---
M src/core/osmo_io.c
1 file changed, 1 insertion(+), 0 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/12/41912/1
diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c
index d6cd57f..906e400 100644
--- a/src/core/osmo_io.c
+++ b/src/core/osmo_io.c
@@ -1068,6 +1068,7 @@
*/
void osmo_iofd_set_alloc_info(struct osmo_io_fd *iofd, unsigned int size, unsigned int headroom)
{
+ OSMO_ASSERT(size + headroom <= 0xffff);
iofd->msgb_alloc.headroom = headroom;
iofd->msgb_alloc.size = size;
}

To view, visit change 41912. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I32822574db8997a02bf18b71bf6ab596e726cb82
Gerrit-Change-Number: 41912
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>