From 1d1adb94597519fc39b35ae40d8517310a23520d Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Mon, 16 Nov 2015 10:47:45 +0000 Subject: [PATCH] Trying to finally silence Coverity CID 28785. --- test/compare_file.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/compare_file.c b/test/compare_file.c index 38620d98..4f5bb04f 100644 --- a/test/compare_file.c +++ b/test/compare_file.c @@ -111,10 +111,12 @@ int Compare_2_files(char *adr1, char *adr2, char *adrc, int flag) } strcpy(a, Ftypetxt(s1.st_mode, 1)); strcat(a, " "); - if(adrc[0]) - strcat(a, adrc); - else + if(adrc[0]) { + if(strlen(a) + strlen(adrc) < 4096) + strcat(a, adrc); + } else { strcat(a, "."); + } ret= lstat(adr2, &s2); if(ret==-1) {