diff options
author | Norbert Slusarek <[email protected]> | 2021-06-20 14:38:42 +0200 |
---|---|---|
committer | Marc Kleine-Budde <[email protected]> | 2021-06-24 08:28:51 +0200 |
commit | aaf473d0100f64abc88560e2bea905805bcf2a8e (patch) | |
tree | 1fb4a353da56ac6f7ebe4a5437e9271fb3485193 /tools/perf/scripts/python/exported-sql-viewer.py | |
parent | c2f5c57d99debf471a1b263cdf227e55f1364e95 (diff) |
can: j1939: j1939_sk_setsockopt(): prevent allocation of j1939 filter for optlen == 0
If optval != NULL and optlen == 0 are specified for SO_J1939_FILTER in
j1939_sk_setsockopt(), memdup_sockptr() will return ZERO_PTR for 0
size allocation. The new filter will be mistakenly assigned ZERO_PTR.
This patch checks for optlen != 0 and filter will be assigned NULL in
case of optlen == 0.
Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol")
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Norbert Slusarek <[email protected]>
Acked-by: Oleksij Rempel <[email protected]>
Signed-off-by: Marc Kleine-Budde <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions