Parent: 4da8cec318185fdf2039f766113a12848c12d09b
Author: Benjamin Berg <bberg@redhat.com>
Committer: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: 2021-06-24 01:33:45
Tree: f3f495a195e929479fe196203e6beae347fcef72
rfkill: Fix reading from rfkill socket The kernel will always send exactly one event, but the size of the passed struct will depend on the length of the submitted read() and the kernel version. i.e. the interface can be extended and we need to expect for a read to be longer than expected if we ask for it. Fix this by only requesting the needed length and explicitly check the length against the V1 version of the structure to make the code a bit more future proof in case the internal copy of the struct is updated to contain new fields.
Diffstat
| M | src/rfkill.c | | | 24 | +++++++++++- - - - - - - - - - - - - |
1 files changed, 11 insertions(+), 13 deletions(-)