[riot-notifications] [RIOT-OS/RIOT] posix_socket: initialize uninitialized fields (#11575)

Sebastian Meiling notifications at github.com
Wed May 29 13:08:06 CEST 2019


smlng requested changes on this pull request.



> @@ -221,6 +221,7 @@ static int _sockaddr_to_ep(const struct sockaddr *address, socklen_t address_len
                 return -1;
             }
             struct sockaddr_in *in_addr = (struct sockaddr_in *)address;
+            memset(out, 0, *out);

I would rather leave this to the caller of this (internal) function, i.e., the calling function should init the struct as needed.

> @@ -221,6 +221,7 @@ static int _sockaddr_to_ep(const struct sockaddr *address, socklen_t address_len
                 return -1;
             }
             struct sockaddr_in *in_addr = (struct sockaddr_in *)address;
+            memset(out, 0, *out);

thereby also avoiding the separate memset for ipv4 and ipv6 here.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11575#pullrequestreview-243187509
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190529/fc618fda/attachment.html>


More information about the notifications mailing list