xiaoxiang781216 commented on a change in pull request #5690:
URL: https://github.com/apache/incubator-nuttx/pull/5690#discussion_r821445713



##########
File path: libs/libc/locale/lib_gettext.c
##########
@@ -119,7 +136,8 @@ static FAR void *momap(FAR const char *path, FAR size_t 
*size)
     {
       *size = st.st_size;
       map = mmap(NULL, *size, PROT_READ, MAP_SHARED, fd, 0);
-      if (map[0] != MO_MAGIC && map[0] != __swap_uint32(MO_MAGIC))
+      if (map != MAP_FAILED &&
+          map[0] != MO_MAGIC && map[0] != __swap_uint32(MO_MAGIC))

Review comment:
       Yes, because *.mo file could be layout in little endian or big endian by 
spec.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to