Gert Doering has uploaded a new patch set (#4) to the change originally created 
by Frank Lichtenheld. ( https://gerrit.openvpn.net/c/openvpn/+/1954?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by Gert Doering


Change subject: Fix various issues found by cppcheck 2.21.0
......................................................................

Fix various issues found by cppcheck 2.21.0

- Fix several constVariablePointer issues that
  were newly reported
- Fix one unreadVariable issue that was newly
  reported
- Remove --showtime=summary from cppcheck args
  again, it is now much more verbose

Change-Id: I6693b5aa2988102f5e7884a65119ebfc87dd07e1
Signed-off-by: Frank Lichtenheld <[email protected]>
Acked-by: Gert Doering <[email protected]>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1954
Message-Id: <[email protected]>
URL: 
https://www.mail-archive.com/[email protected]/msg39671.html
Signed-off-by: Gert Doering <[email protected]>
---
M dev-tools/run-cppcheck.sh
M src/openvpn/dco.c
M src/openvpn/mudp.c
M src/openvpn/pkcs11_openssl.c
M src/openvpn/socks.c
M tests/unit_tests/openvpn/siphash_openssl.c
6 files changed, 5 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/54/1954/4

diff --git a/dev-tools/run-cppcheck.sh b/dev-tools/run-cppcheck.sh
index ad012ac..3c71c83 100755
--- a/dev-tools/run-cppcheck.sh
+++ b/dev-tools/run-cppcheck.sh
@@ -33,7 +33,7 @@
  --suppress-xml=${SCRIPT_DIR}/cppcheck-suppressions.xml --inline-suppr \
  --cppcheck-build-dir=${CPPCHECK_DIR} \
  --check-level=${CPPCHECK_CHECK_LEVEL} --max-configs=10 \
- --error-exitcode=1 --showtime=summary"
+ --error-exitcode=1"

 set -x

diff --git a/src/openvpn/dco.c b/src/openvpn/dco.c
index 6d88f6f..9fc0e3b 100644
--- a/src/openvpn/dco.c
+++ b/src/openvpn/dco.c
@@ -534,7 +534,7 @@
     ASSERT(sock->info.connection_established);

     struct sockaddr *remoteaddr = &sock->info.lsa->actual.dest.addr.sa;
-    struct tls_multi *multi = c->c2.tls_multi;
+    const struct tls_multi *multi = c->c2.tls_multi;
 #ifdef TARGET_FREEBSD
     /* In Linux in P2P mode the kernel automatically removes an existing peer
      * when adding a new peer. FreeBSD needs to explicitly be told to do that 
*/
diff --git a/src/openvpn/mudp.c b/src/openvpn/mudp.c
index 4794b7e..2b08ada 100644
--- a/src/openvpn/mudp.c
+++ b/src/openvpn/mudp.c
@@ -316,10 +316,9 @@
 multi_get_instance_udp_real(struct multi_context *m, struct mroute_addr *real)
 {
     struct hash *hash = m->hash;
-    struct hash_element *he;
     const uint64_t hv = hash_value(hash, real);
     struct hash_bucket *bucket = hash_bucket(hash, hv);
-    he = hash_lookup_fast(hash, bucket, real, hv);
+    const struct hash_element *he = hash_lookup_fast(hash, bucket, real, hv);
     if (he)
     {
         return he->value;
diff --git a/src/openvpn/pkcs11_openssl.c b/src/openvpn/pkcs11_openssl.c
index 69c5a50..24dce84 100644
--- a/src/openvpn/pkcs11_openssl.c
+++ b/src/openvpn/pkcs11_openssl.c
@@ -184,7 +184,6 @@
         {
             tbs = buf;
             tbslen = (size_t)buflen;
-            sigalg.op = "Sign";
         }
         else
         {
diff --git a/src/openvpn/socks.c b/src/openvpn/socks.c
index 19f3d54..65ecb3c 100644
--- a/src/openvpn/socks.c
+++ b/src/openvpn/socks.c
@@ -323,8 +323,7 @@
         return port;
     }

-    struct servent *service;
-    service = getservbyname(servname, NULL);
+    const struct servent *service = getservbyname(servname, NULL);
     if (service)
     {
         return service->s_port;
diff --git a/tests/unit_tests/openvpn/siphash_openssl.c 
b/tests/unit_tests/openvpn/siphash_openssl.c
index c301f2d..99a7763 100644
--- a/tests/unit_tests/openvpn/siphash_openssl.c
+++ b/tests/unit_tests/openvpn/siphash_openssl.c
@@ -101,7 +101,7 @@
 bool
 siphash_openssl_available(void *sip_context)
 {
-    struct siphash_context *sip = sip_context;
+    const struct siphash_context *sip = sip_context;

     return (bool)(sip->mac);
 }

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

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I6693b5aa2988102f5e7884a65119ebfc87dd07e1
Gerrit-Change-Number: 1954
Gerrit-PatchSet: 4
Gerrit-Owner: Frank Lichtenheld <[email protected]>
Gerrit-Reviewer: Gert Doering <[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

Reply via email to