mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-26 14:18:20 +00:00
libdl/archive: Fix the config file string index while removing tailing white space.
Coverity issue 1442540 Updates #3686
This commit is contained in:
@@ -103,7 +103,7 @@ typedef struct rtems_rtl_archives
|
||||
const char* config_name; /**< Config file name. */
|
||||
time_t config_mtime; /**< Config last modified time. */
|
||||
size_t config_length; /**< Length the config data. */
|
||||
const char* config; /**< Config file contents. */
|
||||
char* config; /**< Config file contents. */
|
||||
rtems_chain_control archives; /**< The located archives. */
|
||||
} rtems_rtl_archives;
|
||||
|
||||
|
||||
@@ -528,9 +528,9 @@ rtems_rtl_archives_load_config (rtems_rtl_archives* archives)
|
||||
++b;
|
||||
}
|
||||
b = ls - 1;
|
||||
while (b > 0 && isspace (s[b]))
|
||||
while (b > 0 && isspace (s[r + b]))
|
||||
{
|
||||
s[b] = '\0';
|
||||
s[r + b] = '\0';
|
||||
--b;
|
||||
}
|
||||
r += ls;
|
||||
|
||||
Reference in New Issue
Block a user