summaryrefslogtreecommitdiffstats
path: root/crypto/http
diff options
context:
space:
mode:
authorRandall S. Becker <rsbecker@nexbridge.com>2023-06-01 13:29:15 -0600
committerTomas Mraz <tomas@openssl.org>2023-07-14 12:04:38 +0200
commitba189e0a4bdea86b6142da36adc7f054b6f08c6e (patch)
tree51af6cce556e6bb2aac1ed4510f6252f26b5202c /crypto/http
parentb6bf1cbf1d48bd02f3fae2fb0bf922100efd0be5 (diff)
Modified OSSL_parse_url to initialize pport_num to 0.
This change is intended to provide some safety for uninitialized stack failures that have appeared in 80-test_cmp_http on NonStop x86 when run in a complex CI/CD Jenkins environment. This change also adds init_pint() to handle the initialization of a pointer to int value. Fixes: #21083 Signed-off-by: Randall S. Becker <randall.becker@nexbridge.ca> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21109) (cherry picked from commit 45cd2554efc82f8959b4e8ac53bc419b4d5e195a)
Diffstat (limited to 'crypto/http')
-rw-r--r--crypto/http/http_lib.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/crypto/http/http_lib.c b/crypto/http/http_lib.c
index 8233252812..23327a3b9b 100644
--- a/crypto/http/http_lib.c
+++ b/crypto/http/http_lib.c
@@ -22,6 +22,13 @@ static void init_pstring(char **pstr)
}
}
+static void init_pint(int *pint)
+{
+ if (pint != NULL) {
+ *pint = 0;
+ }
+}
+
static int copy_substring(char **dest, const char *start, const char *end)
{
return dest == NULL
@@ -54,6 +61,7 @@ int OSSL_parse_url(const char *url, char **pscheme, char **puser, char **phost,
init_pstring(puser);
init_pstring(phost);
init_pstring(pport);
+ init_pint(pport_num);
init_pstring(ppath);
init_pstring(pfrag);
init_pstring(pquery);