tools: stack-buffer-overflow reported by asan

This patch fixes buffer overflow in $SRC/tools/setgfid2path/src/main.c
Memory access at offset 196 overflows "pgfid" variable
SUMMARY: AddressSanitizer: stack-buffer-overflow (/lib64/libasan.so.5+0x4e935)

updates: bz#1633930

Change-Id: Ib508c57e96c46b628f63c511437b853b39ae7955
Signed-off-by: Harpreet Kaur <hlalwani@redhat.com>
This commit is contained in:
Harpreet Kaur 2018-12-11 15:07:56 +05:30 committed by Kotresh HR
parent e41fee7ba3
commit 3e3d83ee35

View File

@ -28,7 +28,7 @@ main(int argc, char **argv)
uuid_t pgfid_raw = {
0,
};
char pgfid[36] = "";
char pgfid[36 + 1] = "";
char xxh64[GF_XXH64_DIGEST_LENGTH * 2 + 1] = {
0,
};