forked from Imagelibrary/rtems
cpukit/libdl: Fix incorrect operator precedence access the name
Coverity Issue: CID 1442635 Out-of-bounds access
This commit is contained in:
@@ -1174,6 +1174,7 @@ rtems_rtl_obj_archive_find_obj (int fd,
|
||||
*/
|
||||
if (header[0] == '/')
|
||||
{
|
||||
const char* name_ = *name;
|
||||
off_t extended_off;
|
||||
|
||||
switch (header[1])
|
||||
@@ -1190,7 +1191,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;
|
||||
|
||||
Reference in New Issue
Block a user