Attention is currently required from: fixeria, laforge, pespin. n0k0 has posted comments on this change by n0k0. ( https://gerrit.osmocom.org/c/libasn1c/+/42890?usp=email ) Change subject: constr_CHOICE: fix always-true bounds check ...................................................................... Patch Set 4:
this must first and foremost be fixed in upstream asn1c, if it hasn't yet, as libasn1c is merely a shared library version of the asn1c runtime.
Confirmed already fixed upstream, so nothing new is needed there. Current vlm/asn1c master carries the corrected '&&' guard in CHOICE_outmost_tag (skeletons/constr_CHOICE.c:471): if(present > 0 && present <= td->elements_count) { The || -> && correctness fix landed upstream back in 2017: commit 494fb707a7cbfc8c563c7125efcf801142e0d0ea ("fix warnings", Lev Walkin, 2017-08-07) changed the guard from '||' to '&&', and the follow-up 63a35237b1704f1491f6a8c40dca6a02b3781e96 (2017-08-10) dropped the redundant '(unsigned)' cast, giving the form master ships today. libasn1c 0.9.38 is a stale snapshot of the asn1c runtime skeletons that predates that fix, so this change simply backports the already-upstreamed guard into our vendored copy. No upstream asn1c patch is warranted -- upstream is already correct. (Also amended in patchset 4 to add the missing space after 'if' so gerrit-lint/checkpatch is happy; the '&&' correctness fix is unchanged.) -- To view, visit https://gerrit.osmocom.org/c/libasn1c/+/42890?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: libasn1c Gerrit-Branch: master Gerrit-Change-Id: I25e414729f314505bce50bd8107d61bb1e3a44bf Gerrit-Change-Number: 42890 Gerrit-PatchSet: 4 Gerrit-Owner: n0k0 <osmocom@hacky.software> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> Gerrit-Reviewer: laforge <laforge@osmocom.org> Gerrit-Reviewer: pespin <pespin@sysmocom.de> Gerrit-CC: lynxis lazus <lynxis@fe80.eu> Gerrit-Attention: laforge <laforge@osmocom.org> Gerrit-Attention: fixeria <vyanitskiy@sysmocom.de> Gerrit-Attention: pespin <pespin@sysmocom.de> Gerrit-Comment-Date: Wed, 12 Aug 2026 12:04:10 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: No