pespin has uploaded this change for review. (
https://gerrit.osmocom.org/c/libosmocore/+/41912?usp=email )
Change subject: osmo_io: Assert osmo_iofd_set_alloc_info() params fit in a
16bit value
......................................................................
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 https://gerrit.osmocom.org/c/libosmocore/+/41912?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I32822574db8997a02bf18b71bf6ab596e726cb82
Gerrit-Change-Number: 41912
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>