Stefan Sperling has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11854 )

Change subject: fix use of partly initialized struct in tcp test
......................................................................

fix use of partly initialized struct in tcp test

Properly initialize sockaddr 'name' used by tcp test, and remove
a redundant re-declaration of this variable in a nested scope.

Change-Id: Id6e488308a72be96cca6aa661f088d2c3c67a6a3
Related: CID#188848
---
M test_apps/tcp.c
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  Vadim Yanitskiy: Looks good to me, but someone else must approve
  Neels Hofmeyr: Looks good to me, approved
  Pau Espin Pedrol: Looks good to me, approved



diff --git a/test_apps/tcp.c b/test_apps/tcp.c
index 4e24fa5..4cf681d 100644
--- a/test_apps/tcp.c
+++ b/test_apps/tcp.c
@@ -69,7 +69,7 @@

     /* bind to a local addr */
     if (strlen(local_src) != 0) {
-        struct sockaddr_in name;
+        memset(&name, 0, sizeof(name));
         name.sin_family = AF_INET;
         name.sin_port = htons(local_port);
         name.sin_addr.s_addr = inet_addr(local_src);
@@ -91,6 +91,7 @@
     };

     memcpy(&addr.s_addr, _host.h_addr_list[0], sizeof(struct in_addr));
+    memset(&name, 0, sizeof(name));
     name.sin_family = AF_INET;
     name.sin_port = htons( port );
     name.sin_addr = addr;

--
To view, visit https://gerrit.osmocom.org/11854
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libsmpp34
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Id6e488308a72be96cca6aa661f088d2c3c67a6a3
Gerrit-Change-Number: 11854
Gerrit-PatchSet: 1
Gerrit-Owner: Stefan Sperling <[email protected]>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Neels Hofmeyr <[email protected]>
Gerrit-Reviewer: Pau Espin Pedrol <[email protected]>
Gerrit-Reviewer: Stefan Sperling <[email protected]>
Gerrit-Reviewer: Vadim Yanitskiy <[email protected]>

Reply via email to