patacongo commented on issue #370: net: socket: Introduce net_clear_sinzero() URL: https://github.com/apache/incubator-nuttx/pull/370#issuecomment-591034005 One thing we could do it if matters enough to you is to make a copy of socketadd_in input then clear the sin_zero field in the copy. I don't recommend this for embedded systems but this is most likely what Linux is doing. Linux never accesses any user pointers without going though severl security layers so, for Linux, is it simpler to copy input argument (if they are not large) rather than go through the security measures on every access. If there are no security macros in the code you are looking at, you can be assured that linux is modifying a copy of the user input, not the actual user input itself. That should never be done for a const input.
---------------------------------------------------------------- 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: [email protected] With regards, Apache Git Services
