pespin has submitted this change. ( 
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(-)

Approvals:
  pespin: Looks good to me, approved
  laforge: Looks good to me, but someone else must approve
  fixeria: Looks good to me, but someone else must approve
  Jenkins Builder: Verified




diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c
index bd4f468..617155b 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: merged
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I32822574db8997a02bf18b71bf6ab596e726cb82
Gerrit-Change-Number: 41912
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>

Reply via email to