Attention is currently required from: plaisthos.
Hello plaisthos,
I'd like you to do a code review.
Please visit
http://gerrit.openvpn.net/c/openvpn/+/1452?usp=email
to review the following change.
Change subject: ssl_ncp: Avoid conversion warning in
replace_default_in_ncp_ciphers_option
......................................................................
ssl_ncp: Avoid conversion warning in replace_default_in_ncp_ciphers_option
Change-Id: I380e842b7429060d13bc0264e55fa5c06ab427df
Signed-off-by: Frank Lichtenheld <[email protected]>
---
M src/openvpn/ssl_ncp.c
1 file changed, 3 insertions(+), 11 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/52/1452/1
diff --git a/src/openvpn/ssl_ncp.c b/src/openvpn/ssl_ncp.c
index d4519b0..06262fe 100644
--- a/src/openvpn/ssl_ncp.c
+++ b/src/openvpn/ssl_ncp.c
@@ -534,11 +534,6 @@
}
}
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wconversion"
-#endif
-
/**
* Replaces the string DEFAULT with the string \c replace.
*
@@ -549,12 +544,13 @@
replace_default_in_ncp_ciphers_option(struct options *o, const char *replace)
{
const char *search = "DEFAULT";
- const int ncp_ciphers_len = strlen(o->ncp_ciphers) + strlen(replace) -
strlen(search) + 1;
+ const size_t ncp_ciphers_len = strlen(o->ncp_ciphers) + strlen(replace) -
strlen(search) + 1;
uint8_t *ncp_ciphers = gc_malloc(ncp_ciphers_len, true, &o->gc);
struct buffer ncp_ciphers_buf;
- buf_set_write(&ncp_ciphers_buf, ncp_ciphers, ncp_ciphers_len);
+ ASSERT(ncp_ciphers_len <= INT_MAX);
+ buf_set_write(&ncp_ciphers_buf, ncp_ciphers, (int)ncp_ciphers_len);
const char *def = strstr(o->ncp_ciphers, search);
@@ -571,10 +567,6 @@
o->ncp_ciphers = (char *)ncp_ciphers;
}
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
-
/**
* Checks for availibility of Chacha20-Poly1305 and sets
* the ncp_cipher to either AES-256-GCM:AES-128-GCM or
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1452?usp=email
To unsubscribe, or for help writing mail filters, visit
http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I380e842b7429060d13bc0264e55fa5c06ab427df
Gerrit-Change-Number: 1452
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]>
Gerrit-Reviewer: plaisthos <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel