From 19c6e10bfeb08a83d42b9a96b794225458233861 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Wed, 2 Dec 2020 14:24:25 +0900 Subject: [PATCH] Fix issue detected by static analysis tool Change-Id: Ife5308b75417ae081868f33a83d9418df09b6488 Signed-off-by: Jihoon Kim --- ism/src/ltdl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ism/src/ltdl.cpp b/ism/src/ltdl.cpp index 40805af..b4c9fb7 100644 --- a/ism/src/ltdl.cpp +++ b/ism/src/ltdl.cpp @@ -3169,7 +3169,7 @@ try_dlopen ( /* Handle the case where we occasionally need to read a line that is longer than the initial buffer size. */ - while ((line[LT_STRLEN(line) -1] != '\n') && (!feof (file))) + while (((LT_STRLEN(line) >= 1) && (line[LT_STRLEN(line) -1] != '\n')) && (!feof (file))) { line = LT_DLREALLOC (char, line, line_len *2); if (!fgets (&line[line_len -1], (int) line_len +1, file)) -- 2.7.4