[PATCH] cpukit/libdl: Fix out-of-bounds access of variable 'name' in rtl-archive.c

Harrison Edward Gerber gerberhe11 at gmail.com
Fri Jun 4 03:35:47 UTC 2021


See also CID 1442653

Closes #4449
---
 cpukit/libdl/rtl-archive.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cpukit/libdl/rtl-archive.c b/cpukit/libdl/rtl-archive.c
index 6eba1585b6..c336655871 100644
--- a/cpukit/libdl/rtl-archive.c
+++ b/cpukit/libdl/rtl-archive.c
@@ -1170,7 +1170,7 @@ rtems_rtl_obj_archive_find_obj (int                     fd,
            * return the result.
            */
           *extended_file_names = *ooffset + RTEMS_RTL_AR_FHDR_SIZE;
-          if (*name[0] == '/' && *name[1] == '/')
+          if ((*name)[0] == '/' && (*name)[1] == '/')
           {
             *ooffset = *ooffset + RTEMS_RTL_AR_FHDR_SIZE;
             return true;
-- 
2.25.1



More information about the devel mailing list