From 3d6380cad3915739dc2cb2fb290f535b266a6add Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Thu, 30 Jan 2020 19:08:18 +0900 Subject: [PATCH] Fix infinite loop issue Expression 'i >= 0' is always true , which may be caused by a logical error Change-Id: I28abaf2723feba906ad4dbd02fb5cb4f6f82e27a Signed-off-by: Jihoon Kim --- ism/src/ltdl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ism/src/ltdl.cpp b/ism/src/ltdl.cpp index 6547075..21e6cbc 100644 --- a/ism/src/ltdl.cpp +++ b/ism/src/ltdl.cpp @@ -436,9 +436,9 @@ memmove (lt_ptr dest, const lt_ptr src, size_t size) dest1[i] = src1[i]; } else if (dest > src) - for (i = size -1; i >= 0; --i) + for (i = size; i > 0; --i) { - dest1[i] = src1[i]; + dest1[i-1] = src1[i-1]; } return dest; -- 2.7.4