Change in osmo-hlr[master]: mdns_rfc.c: fix possible access of uninit. mem

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/.

osmith gerrit-no-reply at lists.osmocom.org
Mon Jan 13 14:57:41 UTC 2020


osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hlr/+/16846 )


Change subject: mdns_rfc.c: fix possible access of uninit. mem
......................................................................

mdns_rfc.c: fix possible access of uninit. mem

Fixes: CID#207548
Change-Id: Ifa269d8a88d84c01349668cdd8d1f1d24c12c6d8
---
M src/mslookup/mdns_rfc.c
1 file changed, 6 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/46/16846/1

diff --git a/src/mslookup/mdns_rfc.c b/src/mslookup/mdns_rfc.c
index e1fc184..6f39a8e 100644
--- a/src/mslookup/mdns_rfc.c
+++ b/src/mslookup/mdns_rfc.c
@@ -83,7 +83,12 @@
 		return NULL;
 
 	while (*qname) {
-		size_t len = *qname;
+		size_t len;
+
+		if (i >= qname_max_len)
+			return NULL;
+
+		len = *qname;
 		next_label = qname + len + 1;
 
 		if (next_label >= qname_end || i + len > OSMO_MDNS_RFC_MAX_NAME_LEN)

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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Change-Id: Ifa269d8a88d84c01349668cdd8d1f1d24c12c6d8
Gerrit-Change-Number: 16846
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200113/28a8f817/attachment.htm>


More information about the gerrit-log mailing list