mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 05:18:23 +02:00
platform: avoid crash after calling nl_recv() for old libnl3 version
nl_recv() in libnl3 before version 3.2.15 would return dangling pointers if nl_recv() fails or has nothing to read [1]. Workaround that by explicitly clearing @buf and @creds. https://bugzilla.gnome.org/show_bug.cgi?id=767986 [1]69468517d0(cherry picked from commit66715515dc)
This commit is contained in:
parent
78c3d14a68
commit
9bd444b3b1
1 changed files with 7 additions and 0 deletions
|
|
@ -5792,6 +5792,13 @@ continue_reading:
|
|||
errno = 0;
|
||||
n = nl_recv (sk, &nla, &buf, &creds);
|
||||
|
||||
if (n <= 0) {
|
||||
/* workaround libnl3 <= 3.2.15 returning danling pointers in case nl_recv()
|
||||
* fails. Fixed by libnl3 69468517d0de1675d80f24661ff57a5dbac7275c. */
|
||||
buf = NULL;
|
||||
creds = NULL;
|
||||
}
|
||||
|
||||
switch (n) {
|
||||
case 0:
|
||||
/* Work around a libnl bug fixed in 3.2.22 (375a6294) */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue