diff options
author | Benoît Ganne <bganne@cisco.com> | 2020-07-16 12:03:35 +0200 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2020-07-16 21:41:12 +0000 |
commit | 1bd6f61820c6c15534ebb04a4b070ba84bf08a9d (patch) | |
tree | 5cc63818ce49ae6cd0b886f20f0edebdf56a2eb6 /src/vppinfra | |
parent | 65b65a4692c84462ecf500806795ea0350073e18 (diff) |
vppinfra: fix format_c_identifier vector overflow
In case of vector, we must check length before trying to access element.
Also fix wrong DPDK plugin workaround.
Type: fix
Change-Id: I2ecef1c88ebef2362f48cab0d462699aa43cd4b9
Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/vppinfra')
-rw-r--r-- | src/vppinfra/std-formats.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vppinfra/std-formats.c b/src/vppinfra/std-formats.c index b771b947e27..62d309e2fb0 100644 --- a/src/vppinfra/std-formats.c +++ b/src/vppinfra/std-formats.c @@ -281,7 +281,7 @@ format_c_identifier (u8 * s, va_list * va) l = vec_len (id); if (id) - for (i = 0; id[i] != 0 && i < l; i++) + for (i = 0; i < l && id[i] != 0; i++) { u8 c = id[i]; |