summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-01-27 17:48:36 -0800
committerGarrett D'Amore <garrett@damore.org>2024-01-27 17:51:21 -0800
commitb4c8d7ac6141a6a1e19c00f4800e4571ab58f8e7 (patch)
tree7514611b1764d8046c9dab7797e0f548f5cede93
parent75a094b9fd567c7002b26fc06bdc04d7fbc5ea7f (diff)
downloadnng-b4c8d7ac6141a6a1e19c00f4800e4571ab58f8e7.tar.gz
nng-b4c8d7ac6141a6a1e19c00f4800e4571ab58f8e7.tar.bz2
nng-b4c8d7ac6141a6a1e19c00f4800e4571ab58f8e7.zip
tls: fix cast to integer warning
-rw-r--r--src/supplemental/tls/mbedtls/tls.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/supplemental/tls/mbedtls/tls.c b/src/supplemental/tls/mbedtls/tls.c
index 79f3ffd4..03fd231b 100644
--- a/src/supplemental/tls/mbedtls/tls.c
+++ b/src/supplemental/tls/mbedtls/tls.c
@@ -1,5 +1,5 @@
//
-// Copyright 2021 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2024 Staysail Systems, Inc. <info@staysail.tech>
// Copyright 2018 Capitar IT Group BV <info@capitar.com>
// Copyright 2019 Devolutions <info@devolutions.net>
//
@@ -296,7 +296,7 @@ conn_peer_cn(nng_tls_engine_conn *ec)
}
pos += 3;
- len -= pos - buf - 1;
+ len -= (int) (pos - buf - 1);
if (len <= 1) {
return (NULL);
}
@@ -314,23 +314,26 @@ conn_peer_alt_names(nng_tls_engine_conn *ec)
return (NULL);
}
- const mbedtls_asn1_sequence * seq = &crt->subject_alt_names;
+ const mbedtls_asn1_sequence *seq = &crt->subject_alt_names;
// get count
int count = 0;
do {
- if (seq->buf.len > 0) ++count;
+ if (seq->buf.len > 0)
+ ++count;
seq = seq->next;
} while (seq);
- if (count == 0) return NULL;
+ if (count == 0)
+ return NULL;
seq = &crt->subject_alt_names;
// copy strings
- char ** rv = malloc((count + 1) * sizeof(char *));
- int i = 0;
+ char **rv = malloc((count + 1) * sizeof(char *));
+ int i = 0;
do {
- if (seq->buf.len == 0) continue;
+ if (seq->buf.len == 0)
+ continue;
rv[i] = malloc(seq->buf.len + 1);
memcpy(rv[i], seq->buf.p, seq->buf.len);