trace: fix the snprintf warning issue.

The complier complains:

/usr/include/bits/stdio2.h:71:10: note: ‘__builtin___snprintf_chk’
output between 4 and 19 bytes into a destination of size 7
71 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,

So we change the array size from 7 to 20, so it is enough to put 19 bytes
in.

Fixes #issue 2014

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I97dfbf9707d0e275382324fa7352b7a212b2aeb5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8694
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
This commit is contained in:
Ziye Yang 2021-07-07 19:29:49 +08:00 committed by Tomasz Zawadzki
parent 6317642ce6
commit 36b5a69bb0

View File

@ -123,7 +123,7 @@ rpc_trace_get_tpoint_group_mask(struct spdk_jsonrpc_request *request,
const struct spdk_json_val *params)
{
uint64_t tpoint_group_mask;
char mask_str[7];
char mask_str[20];
bool enabled;
struct spdk_json_write_ctx *w;
struct spdk_trace_register_fn *register_fn;