Attention is currently required from: pespin. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/35791?usp=email ) Change subject: abis_nm: fix -Wunused-but-set-variable (bug) ...................................................................... Patch Set 2: (1 comment) File src/osmo-bsc/abis_nm.c: https://gerrit.osmocom.org/c/osmo-bsc/+/35791/comment/c3b69e51_2e3703b5 PS2, Line 2168: const uint8_t *attr, int attr_len)
what about converting attr_len to 0? it makes no sense to have a negative len to start with.... This function gets `attr` / `attr_len` from an non-trusted source (received OML message). The `attr_len` is calculated as follows: `oh->length - sizeof(*foh)`, so we may end up with a negative number and this is why I am additionally checking this. If we change to unsigned, a negative number would turn into a huge number passing all our size checks.
-- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/35791?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I3ca8e761fdf99dd498a979ccc9d53c6c3e03e2cc Gerrit-Change-Number: 35791 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge@osmocom.org> Gerrit-CC: pespin <pespin@sysmocom.de> Gerrit-Attention: pespin <pespin@sysmocom.de> Gerrit-Comment-Date: Mon, 05 Feb 2024 12:44:11 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: pespin <pespin@sysmocom.de> Gerrit-MessageType: comment