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 2020/05/03 03:29:06 UTC

[GitHub] [incubator-nuttx] btashton opened a new pull request #952: ioctl should check if int will fit in unsigned long not be exactly unsigned long

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


   ## Summary
   This is to address #951 I am not quite sure if there is a side effect that I am not clear on.
   This is only changing debugassert so it does not actually change operation outside of debugging.
   ## Impact
   This allows running code that calls ioctl from 64 bit platforms.
   
   ## Testing
   This was tested against x86_64.
   
   


----------------------------------------------------------------
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.

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



[GitHub] [incubator-nuttx] patacongo commented on a change in pull request #952: ioctl should check if int will fit in unsigned long not be exactly unsigned long

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



##########
File path: libs/libc/misc/lib_ioctl.c
##########
@@ -91,7 +91,7 @@ int ioctl(int fd, int req, ...)
   /* Get the unsigned long argument.
    *
    * REVISIT:  This could be the cause of the crash down the road if the
-   * actual size of the argument is anything other than sizeof(unsigned long).
+   * actual size of the argument not sizeof(unsigned long).

Review comment:
       ```suggestion
      * actual size of the argument is not sizeof(unsigned long).
   ```




----------------------------------------------------------------
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.

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



[GitHub] [incubator-nuttx] patacongo commented on a change in pull request #952: ioctl should check if int will fit in unsigned long not be exactly unsigned long

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



##########
File path: libs/libc/misc/lib_ioctl.c
##########
@@ -102,7 +102,7 @@ int ioctl(int fd, int req, ...)
    * discover cases where something worse happens!
    */
 
-  DEBUGASSERT(sizeof(int)        == sizeof(unsigned long) &&
+  DEBUGASSERT(sizeof(int)        <= sizeof(unsigned long) &&

Review comment:
       Thinking more about this, I think we should just remove this check.  sizeof(int) is guanteed to C requirements to be less than or equal to sizeof(unsigned long).  So this is just checking if the compiler is sane.  It is not checking anything of value..




----------------------------------------------------------------
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.

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