Fix issue detected by static analysis tool 58/248758/2 submit/tizen/20201201.052229
authorJihoon Kim <jihoon48.kim@samsung.com>
Wed, 2 Dec 2020 05:24:25 +0000 (14:24 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Wed, 2 Dec 2020 05:50:23 +0000 (14:50 +0900)
Change-Id: Ife5308b75417ae081868f33a83d9418df09b6488
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
ism/src/ltdl.cpp

index 40805af..b4c9fb7 100644 (file)
@@ -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))