mirror of
https://gitee.com/openharmony/third_party_libnl
synced 2024-11-27 20:20:30 +00:00
lib: check for integer-overflow in nlmsg_reserve()
In general, libnl functions are not robust against calling with invalid arguments. Thus, never call libnl functions with invalid arguments. In case of nlmsg_reserve() this means never provide a @len argument that causes overflow. Still, add an additional safeguard to avoid exploiting such bugs. Assume that @pad is a trusted, small integer. Assume that n->nm_size is a valid number of allocated bytes (and thus much smaller then SIZE_T_MAX). Assume, that @len may be set to an untrusted value. Then the patch avoids an integer overflow resulting in reserving too few bytes.
This commit is contained in:
parent
3dd2a0f26f
commit
3e18948f17
Loading…
Reference in New Issue
Block a user