summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarpreet Kaur <hlalwani@redhat.com>2018-12-11 15:07:56 +0530
committerKotresh HR <khiremat@redhat.com>2018-12-12 04:45:01 +0000
commit3e3d83ee359c8bc8a8694865e0a8af869b2b8f33 (patch)
tree643742f499e8dde32b9bcee1b7085c18243bded0
parente41fee7ba316655cdaafb9234a1590051f82db11 (diff)
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>
-rw-r--r--tools/setgfid2path/src/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/setgfid2path/src/main.c b/tools/setgfid2path/src/main.c
index 2e25ea8ab3d..4320a7b2481 100644
--- a/tools/setgfid2path/src/main.c
+++ b/tools/setgfid2path/src/main.c
@@ -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,
};