diff options
author | Steven Luong <sluong@cisco.com> | 2019-08-21 11:35:27 -0700 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2019-08-22 10:27:34 +0000 |
commit | ab4899257a77edecfbf9a97cf67acc26a2133119 (patch) | |
tree | 30ce7810935d4f509a792735d6e73f64784c5e83 /src/vlib/node_format.c | |
parent | b6834750c076909d096366f77337e54055575142 (diff) |
vlib: fix null pointer crash on strncmp
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff4b71de0 in __strncmp_sse42 () from /lib64/libc.so.6
(gdb) up
up
vm=0x7ffff6664d40 <vlib_global_main>, addr=0x7fffb4bec6d0,
ids=0x7fffb31675f0 <avf_pci_device_ids>, handle=0x7fffb4bec594)
at /usr/src/debug/vpp-20.01/src/vlib/linux/pci.c:1250
1250 if (strncmp ("vfio-pci", (char *) di->driver_name, 8) == 0)
(gdb) p di
p di
$1 = (vlib_pci_device_info_t *) 0x7fffb6446164
(gdb) p di->driver_name
p di->driver_name
$2 = (u8 *) 0x0
(gdb)
driver_name may be null. strncmp is not forgiving. Change to use C11 safeC
version.
Type: fix
Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I1777a5966ceee7409d7bde86c30b14dc75534a5a
Diffstat (limited to 'src/vlib/node_format.c')
0 files changed, 0 insertions, 0 deletions