Change in libosmocore[master]: conv: prevent theoretical NULL pointer dereference in osmo_conv_encode()

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Mon Feb 10 09:58:59 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/17108 )

Change subject: conv: prevent theoretical NULL pointer dereference in osmo_conv_encode()
......................................................................

conv: prevent theoretical NULL pointer dereference in osmo_conv_encode()

A caller shall never pass NULL to osmo_conv_encode().

Change-Id: Ice0050cd7c7e3fcbf57c2c73682ca28843a92d8b
Fixes: CID#208174
---
M src/conv.c
1 file changed, 2 insertions(+), 0 deletions(-)

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



diff --git a/src/conv.c b/src/conv.c
index a2c13de..06c4299 100644
--- a/src/conv.c
+++ b/src/conv.c
@@ -36,6 +36,7 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include <osmocom/core/utils.h>
 #include <osmocom/core/bits.h>
 #include <osmocom/core/conv.h>
 
@@ -87,6 +88,7 @@
                       const struct osmo_conv_code *code)
 {
 	memset(encoder, 0x00, sizeof(struct osmo_conv_encoder));
+	OSMO_ASSERT(code != NULL);
 	encoder->code = code;
 }
 

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/17108
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ice0050cd7c7e3fcbf57c2c73682ca28843a92d8b
Gerrit-Change-Number: 17108
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200210/7fa2c8ba/attachment.htm>


More information about the gerrit-log mailing list