[XS] Change in openvpn[master]: pool: Fix a potential NULL pointer de-reference in test code

"cron2 (Code Review)" <[email protected]>
Newsgroups gmane.network.openvpn.devel
Message-ID <[email protected]>
cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1676?usp=email )

Change subject: pool: Fix a potential NULL pointer de-reference in test code
......................................................................

pool: Fix a potential NULL pointer de-reference in test code

Identified by cppcheck. Probably has been a long time
since that code has been compiled, though.

Change-Id: I09ebbf6f3555dd68ce8d75bfa844ecac518a0cf2
Signed-off-by: Frank Lichtenheld <[email protected]>
Acked-by: Gert Doering <[email protected]>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1676
Message-Id: <[email protected]>
URL: https://www.mail-archive.com/[email protected]/msg36865.html
Signed-off-by: Gert Doering <[email protected]>
---
M src/openvpn/pool.c
1 file changed, 2 insertions(+), 2 deletions(-)




diff --git a/src/openvpn/pool.c b/src/openvpn/pool.c
index 15004c0..ff74e7c 100644
--- a/src/openvpn/pool.c
+++ b/src/openvpn/pool.c
@@ -757,7 +757,7 @@
             break;
         }
         msg(M_INFO | M_NOPREFIX, "IFCONFIG_POOL TEST pass 1: l=%s r=%s cn=%s",
-            print_in_addr_t(local, 0, &gc), print_in_addr_t(remote, 0, &gc), cn);
+            print_in_addr_t(local, 0, &gc), print_in_addr_t(remote, 0, &gc), cn ? cn : "[NULL]");
         array[i] = h;
     }
 
@@ -793,7 +793,7 @@
             break;
         }
         msg(M_INFO | M_NOPREFIX, "IFCONFIG_POOL TEST pass 3: l=%s r=%s cn=%s",
-            print_in_addr_t(local, 0, &gc), print_in_addr_t(remote, 0, &gc), cn);
+            print_in_addr_t(local, 0, &gc), print_in_addr_t(remote, 0, &gc), cn ? cn : "[NULL]");
         array[i] = h;
     }
 

-- 
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1676?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09ebbf6f3555dd68ce8d75bfa844ecac518a0cf2
Gerrit-Change-Number: 1676
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <[email protected]>
Gerrit-Reviewer: cron2 <[email protected]>
Gerrit-Reviewer: plaisthos <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.