Attention is currently required from: osmith, pespin.
fixeria has posted comments on this change. (
https://gerrit.osmocom.org/c/osmo-sgsn/+/29279 )
Change subject: llc: gprs_llc_hdr_parse(): make the input data pointer const
......................................................................
Patch Set 1:
(1 comment)
File src/gprs/gprs_llc_parse.c:
https://gerrit.osmocom.org/c/osmo-sgsn/+/29279/comment/5c75eb8a_83f99ee4
PS1, Line 138: ghp->data = (uint8_t *)&ctrl[3];
You are also telling the user that calling the
function won't make any kind of modification at any time to contents of that address
at any time.
Not at any time, but only during the function exec time.
What if the user passes a const pointer coming from a
write-protected memory region?
Then it's still responsibility of the user to not modify a write-protected memory
region. There exist functions in glibc internally casting const to non-const, e.g.
memchr(), strchr(), or strstr(). Do you also consider them wrong?
--
To view, visit
https://gerrit.osmocom.org/c/osmo-sgsn/+/29279
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I9757d2be5af589ccbe4d3d406637a33690284754
Gerrit-Change-Number: 29279
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 07 Sep 2022 09:46:47 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: comment