Attention is currently required from: pespin. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-hlr/+/30777 )
Change subject: mslookup: use apn functions from libosmocore ...................................................................... Patch Set 1: (2 comments) File src/mslookup/mdns_rfc.c: https://gerrit.osmocom.org/c/osmo-hlr/+/30777/comment/c55ea0f8_a9087fc5 PS1, Line 80: if (osmo_apn_from_str(buf, buf_len, qst->domain) < 0) > so in here you are assuming that encoding the string into the msg will take > always exactly strlen(qs […] Yes. Each part of the domain is encoded with a label that consists of the size and the string. There's always one more label length than the amount of dots. For example: "osmocom.org" -> len 11 0x07, 'o', 's', 'm', 'o', 'c', 'o', 'm', 0x03, 'o', 'r', 'g' -> len 12 https://gerrit.osmocom.org/c/osmo-hlr/+/30777/comment/94ad6489_69bf7e46 PS1, Line 105: ret->domain = talloc_size(ret, qname_len - 1); > I'd expect the string to be longer than the buffer due to \0? Is this correct? qname_len is the size of the encoded domain name + 0x00 at the end, e.g. 0x07, 'o', 's', 'm', 'o', 'c', 'o', 'm', 0x03, 'o', 'r', 'g', 0x00 -> len 13 Therefore "osmocom.org" with 0x00 at the end needs one char less, so it's correct as written there. -- To view, visit https://gerrit.osmocom.org/c/osmo-hlr/+/30777 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Change-Id: I09d3c617fd6eb4075084ee106d3f3c5803861d2f Gerrit-Change-Number: 30777 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <[email protected]> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: pespin <[email protected]> Gerrit-Attention: pespin <[email protected]> Gerrit-Comment-Date: Fri, 23 Dec 2022 13:11:01 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: pespin <[email protected]> Gerrit-MessageType: comment
