pkarashchenko commented on a change in pull request #5527:
URL: https://github.com/apache/incubator-nuttx/pull/5527#discussion_r808861949



##########
File path: libs/libnx/nxmu/nx_eventhandler.c
##########
@@ -143,6 +143,10 @@ int nx_eventhandler(NXHANDLE handle)
                 }
             }
         }
+      else if (nbytes == 0)
+        {
+          return OK;

Review comment:
       I think that the nature of an error is that `DEBUGASSERT(nbytes >= 
sizeof(struct nxclimsg_s));` is not hit if `CONFIG_DEBUG_ASSERTIONS` is off, 
but maybe I'm wrong. Maybe it is reasonable to add
   ```
   if (nbytes < sizeof(struct nxclimsg_s))
     {
       _NX_SETERRNO(EBADMSG);
      return ERROR;
     }
   ```
   instead of this change? What do you think?

##########
File path: libs/libnx/nxmu/nx_eventhandler.c
##########
@@ -143,6 +143,10 @@ int nx_eventhandler(NXHANDLE handle)
                 }
             }
         }
+      else if (nbytes == 0)
+        {
+          return OK;

Review comment:
       I think that the nature of an error is that `DEBUGASSERT(nbytes >= 
sizeof(struct nxclimsg_s));` is not hit if `CONFIG_DEBUG_ASSERTIONS` is off, 
but maybe I'm wrong. Maybe it is reasonable to add
   ```
   if (nbytes < sizeof(struct nxclimsg_s))
     {
       _NX_SETERRNO(EBADMSG);
       return ERROR;
     }
   ```
   instead of this change? What do you think?




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to