Code Review
/
vpp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(from parent 1:
da052b6
)
devices: fix crash on invalid interface
84/36084/3
author
Gabriel Ganne
<gabriel.ganne@gmail.com>
Thu, 5 May 2022 08:16:56 +0000
(10:16 +0200)
committer
Damjan Marion
<dmarion@me.com>
Sun, 8 May 2022 14:00:11 +0000
(14:00 +0000)
Type: fix
A simple "create host-interface name xxx" is enough to trigger the bug:
The interface is not found, and we goto error with apif=NULL
Signed-off-by: Gabriel Ganne <gabriel.ganne@gmail.com>
Change-Id: I2f894176d39b3d15efab054dc7340e7a0600a2e8
src/vnet/devices/af_packet/af_packet.c
patch
|
blob
|
history
diff --git
a/src/vnet/devices/af_packet/af_packet.c
b/src/vnet/devices/af_packet/af_packet.c
index
10b0ff2
..
83c1068
100644
(file)
--- a/
src/vnet/devices/af_packet/af_packet.c
+++ b/
src/vnet/devices/af_packet/af_packet.c
@@
-679,8
+679,11
@@
error:
fd2 = -1;
}
vec_free (host_if_name_dup);
- memset (apif, 0, sizeof (*apif));
- pool_put (apm->interfaces, apif);
+ if (apif)
+ {
+ memset (apif, 0, sizeof (*apif));
+ pool_put (apm->interfaces, apif);
+ }
return ret;
}