]> git.ipfire.org Git - people/ms/strongswan.git/commit
traffic-selector: Avoid out-of-bound array access when calculating range master
authorTobias Brunner <tobias@strongswan.org>
Wed, 16 Mar 2022 10:45:49 +0000 (11:45 +0100)
committerTobias Brunner <tobias@strongswan.org>
Wed, 16 Mar 2022 10:54:34 +0000 (11:54 +0100)
commit3c028686debff96abb2470e9e9af7e6c859d7db0
treed98246054ed981839ffac5f697125ab2dc83c9ca
parent8100f2f255bd1a48a858fedd9797478eea98ddcb
traffic-selector: Avoid out-of-bound array access when calculating range

This happens for `/0` subnet masks.  In practice, it's not an issue because
if `bytes` is 0, then so are `netbits`, `bits` and `mask`.  So the two
incorrectly addressed array elements are not actually modified.  The first
operation is a `&= 0xff` and the second a `|= 0`, so nothing changes.
But some tools might not consider the values and report this as undefined
behavior, which it technically is.
src/libstrongswan/selectors/traffic_selector.c