[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 19/31: testcurl/https: added proper check for snprintf()
From: |
gnunet |
Subject: |
[libmicrohttpd] 19/31: testcurl/https: added proper check for snprintf() result |
Date: |
Mon, 10 Oct 2022 13:01:04 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 6e78e8022576955e89ff3626d9019320bd5d2228
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Thu Oct 6 19:13:52 2022 +0300
testcurl/https: added proper check for snprintf() result
---
src/testcurl/https/tls_test_common.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/src/testcurl/https/tls_test_common.c
b/src/testcurl/https/tls_test_common.c
index 639bccf1..f27813a2 100644
--- a/src/testcurl/https/tls_test_common.c
+++ b/src/testcurl/https/tls_test_common.c
@@ -320,15 +320,18 @@ gen_test_file_url (char *url,
size_t url_len,
uint16_t port)
{
- unsigned int ret = 0;
- /* construct url */
- if ((size_t) snprintf (url,
- url_len,
- "https://127.0.0.1:%u/urlpath",
- (unsigned int) port) >= url_len)
- ret = 1;
+ int res;
- return ret;
+ res = snprintf (url,
+ url_len,
+ "https://127.0.0.1:%u/urlpath",
+ (unsigned int) port);
+ if (res <= 0)
+ return 1;
+ if ((size_t) res >= url_len)
+ return 1;
+
+ return 0;
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] 17/31: MHD_poll(): removed unneeded check, (continued)
- [libmicrohttpd] 17/31: MHD_poll(): removed unneeded check, gnunet, 2022/10/10
- [libmicrohttpd] 18/31: testcurl/https: significantly simplified test URI, gnunet, 2022/10/10
- [libmicrohttpd] 25/31: test_https_get_parallel_threads: removed libcurl-GnuTLS requirement, gnunet, 2022/10/10
- [libmicrohttpd] 09/31: testcurl/https: enable verbose libcurl on debug builds, gnunet, 2022/10/10
- [libmicrohttpd] 21/31: test_tls_extensions: removed unused test, gnunet, 2022/10/10
- [libmicrohttpd] 29/31: https tests: updated self-signed certificate, gnunet, 2022/10/10
- [libmicrohttpd] 20/31: testcurl/https: some simplifications and clean-ups, gnunet, 2022/10/10
- [libmicrohttpd] 23/31: microhttpd.h: minor doxy fix, gnunet, 2022/10/10
- [libmicrohttpd] 24/31: digestauth.h: removed leftover in doxy, gnunet, 2022/10/10
- [libmicrohttpd] 30/31: test_tls_authentication: fixed to really test TLS authentication, gnunet, 2022/10/10
- [libmicrohttpd] 19/31: testcurl/https: added proper check for snprintf() result,
gnunet <=
- [libmicrohttpd] 22/31: test_https_session_info: removed hardcoded TLS version, gnunet, 2022/10/10
- [libmicrohttpd] 31/31: testcurl/https: updated copyright year in modified files, fixed some doxy, gnunet, 2022/10/10
- [libmicrohttpd] 26/31: tls_test_common: fixed comments and error messages, gnunet, 2022/10/10
- [libmicrohttpd] 27/31: test_tls_options: re-implemented, removed hardcoded TLS versions, gnunet, 2022/10/10
- [libmicrohttpd] 28/31: https tests: renamed private key variable to match certificate name, gnunet, 2022/10/10