Projects
Eulaceura:Mainline:GA
libnl3
_service:obs_scm:backport-accept-NULL-argument-...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:backport-accept-NULL-argument-in-nla_nest_cancel-for-robustness.patch of Package libnl3
From 6af26981e727149e2e3fdfac85e2ef86b3828b11 Mon Sep 17 00:00:00 2001 From: Thomas Haller <thaller@redhat.com> Date: Wed, 26 Jul 2023 16:17:18 +0200 Subject: [PATCH] lib: accept NULL argument in nla_nest_cancel() for robustness Previously, a NULL argument would most likely also do thing, but it also hits undefined behavior. Conflict:NA Reference:https://github.com/thom311/libnl/commit/6af26981e727149e2e3fdfac85e2ef86b3828b11 --- lib/attr.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/attr.c b/lib/attr.c index a4f5852..2b2d538 100644 --- a/lib/attr.c +++ b/lib/attr.c @@ -996,6 +996,15 @@ void nla_nest_cancel(struct nl_msg *msg, const struct nlattr *attr) { ssize_t len; + if (!attr) { + /* For robustness, allow a NULL attr to do nothing. NULL is also + * what nla_nest_start() when out of buffer space. + * + * Warning, before libnl-3.8, the function did not accept NULL! + * If you care, catch NULL yourself. */ + return; + } + len = (char *) nlmsg_tail(msg->nm_nlh) - (char *) attr; if (len < 0) BUG(); -- 2.33.0
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2