#
2ba8d0ad |
| 18-Jan-2023 |
Bruce Richardson <bruce.richardson@intel.com> |
examples/cmdline: fix build with GCC 12
When building the example without libbsd and using the DPDK-provided strlcpy function, a compiler warning is emitted by GCC 12 about the copy of the parsed st
examples/cmdline: fix build with GCC 12
When building the example without libbsd and using the DPDK-provided strlcpy function, a compiler warning is emitted by GCC 12 about the copy of the parsed string into the resulting object. This is because the source from cmdline library is 128 bytes and the destination buffer is 64-bytes.
commands.c: In function 'cmd_obj_add_parsed': rte_string_fns.h:61:24: warning: '%s' directive output may be truncated writing up to 127 bytes into a region of size 64 [-Wformat-truncation=] 61 | return (size_t)snprintf(dst, size, "%s", src); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/stdio.h:894, from commands.c:7: /usr/include/x86_64-linux-gnu/bits/stdio2.h:71:10: note: '__builtin_snprintf' output between 1 and 128 bytes into a destination of size 64
Multiple options are possible to fix this, but the one taken in this patch is to ensure truncation never occurs by setting the destination buffer size to be the same as that used by the cmdline library.
Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
show more ...
|
#
0cdc9c96 |
| 23-Jan-2018 |
Lee Daly <lee.daly@intel.com> |
examples/cmdline: convert to SPDX license tag
This updates the license on files in examples to be the standard BSD-3-Clause license used for the rest of DPDK, bringing the files in compliance with t
examples/cmdline: convert to SPDX license tag
This updates the license on files in examples to be the standard BSD-3-Clause license used for the rest of DPDK, bringing the files in compliance with the DPDK licensing policy.
Signed-off-by: Lee Daly <lee.daly@intel.com> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
show more ...
|
#
aaa662e7 |
| 05-Dec-2014 |
Alan Carew <alan.carew@intel.com> |
cmdline: fix overflow on bsd
When using test-pmd with flow director in FreeBSD, the application will segfault/Bus error while parsing the command-line. This is due to how each commands result struct
cmdline: fix overflow on bsd
When using test-pmd with flow director in FreeBSD, the application will segfault/Bus error while parsing the command-line. This is due to how each commands result structure is represented during parsing, where the offsets for each tokens value is stored in a character array(char result_buf[BUFSIZ]) in cmdline_parse()(./lib/librte_cmdline/cmdline_parse.c).
The overflow occurs where BUFSIZ is less than the size of a commands result structure, in this case "struct cmd_pkt_filter_result" (app/test-pmd/cmdline.c) is 1088 bytes and BUFSIZ on FreeBSD is 1024 bytes as opposed to 8192 bytes on Linux.
The problem can be reproduced by running test-pmd on FreeBSD: ./testpmd -c 0x3 -n 4 -- -i --portmask=0x3 --pkt-filter-mode=perfect And adding a filter: add_perfect_filter 0 udp src 192.168.0.0 1024 dst 192.168.0.0 1024 flexbytes 0x800 vlan 0 queue 0 soft 0x17
This patch removes the OS dependency on BUFSIZ and defines and uses a library #define CMDLINE_PARSE_RESULT_BUFSIZE 8192
Added boundary checking to ensure this buffer size cannot overflow, with an error message being produced.
Suggested-by: Olivier Matz <olivier.matz@6wind.com> http://git.droids-corp.org/?p=libcmdline.git;a=commitdiff;h=b1d5b169352e57df3fc14c51ffad4b83f3e5613f
Signed-off-by: Alan Carew <alan.carew@intel.com> Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Tested-by: Bruce Richardson <bruce.richardson@intel.com>
show more ...
|
#
3031749c |
| 03-Jun-2014 |
Bruce Richardson <bruce.richardson@intel.com> |
remove trailing whitespaces
This commit removes trailing whitespace from lines in files. Almost all files are affected, as the BSD license copyright header had trailing whitespace on 4 lines in it [
remove trailing whitespaces
This commit removes trailing whitespace from lines in files. Almost all files are affected, as the BSD license copyright header had trailing whitespace on 4 lines in it [hence the number of files reporting 8 lines changed in the diffstat].
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> [Thomas: remove spaces before tabs in libs] [Thomas: remove more trailing spaces in non-C files] Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
show more ...
|
#
e9d48c00 |
| 10-Feb-2014 |
Bruce Richardson <bruce.richardson@intel.com> |
update Intel copyright years to 2014
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
|
#
1c1d4d7a |
| 18-Sep-2013 |
Intel <intel.com> |
doc: whitespace changes in licenses
Signed-off-by: Intel
|
#
b6df9fc8 |
| 12-Mar-2013 |
Intel <intel.com> |
update copyright date to 2013
Signed-off-by: Intel
|
#
dada9ef6 |
| 19-Dec-2012 |
Intel <intel.com> |
remove version in all files
Signed-off-by: Intel
|
#
af75078f |
| 04-Sep-2012 |
Intel <intel.com> |
first public release
version 1.2.3
Signed-off-by: Intel
|