You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/04/01 12:17:03 UTC

[GitHub] [incubator-nuttx] anjiahao1 opened a new pull request #5951: modlib/modlib_bind:fix unsigned_compare with zero

anjiahao1 opened a new pull request #5951:
URL: https://github.com/apache/incubator-nuttx/pull/5951


   r_offset is a unsigned type
   Signed-off-by: anjiahao <an...@xiaomi.com>
   


-- 
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-unsubscribe@nuttx.apache.org

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



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5951: modlib/modlib_bind:fix unsigned_compare with zero

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5951:
URL: https://github.com/apache/incubator-nuttx/pull/5951#discussion_r840537177



##########
File path: libs/libc/modlib/modlib_bind.c
##########
@@ -485,7 +485,7 @@ static int modlib_relocateadd(FAR struct module_s *modp,
 
       /* Calculate the relocation address. */
 
-      if (rela->r_offset < 0 ||
+      if (rela->r_offset ||
           rela->r_offset > dstsec->sh_size - sizeof(uint32_t))

Review comment:
       ```suggestion
             rela->r_offset + sizeof(uint32_t) > dstsec->sh_size)
   ```




-- 
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-unsubscribe@nuttx.apache.org

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



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5951: modlib/modlib_bind:fix unsigned_compare with zero

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5951:
URL: https://github.com/apache/incubator-nuttx/pull/5951#discussion_r840529135



##########
File path: libs/libc/modlib/modlib_bind.c
##########
@@ -297,7 +297,7 @@ static int modlib_relocate(FAR struct module_s *modp,
 
       /* Calculate the relocation address. */
 
-      if (rel->r_offset < 0 ||
+      if (rel->r_offset ||
           rel->r_offset > dstsec->sh_size - sizeof(uint32_t))

Review comment:
       should we then?
   ```suggestion
             rel->r_offset + sizeof(uint32_t) > dstsec->sh_size)
   ```




-- 
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-unsubscribe@nuttx.apache.org

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



[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #5951: modlib/modlib_bind:fix unsigned_compare with zero

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #5951:
URL: https://github.com/apache/incubator-nuttx/pull/5951


   


-- 
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-unsubscribe@nuttx.apache.org

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