Skip to content

Commit d5a1eea

Browse files
committed
session mbedtls BUGFIX avoid void arithmetic
1 parent 6a2a838 commit d5a1eea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/session_mbedtls.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1946,13 +1946,13 @@ nc_tls_append_cipher_suite_wrap(struct nc_server_tls_opts *opts, const char *cip
19461946
/* append the cipher suite to a zero terminated array */
19471947
if (!opts->ciphers) {
19481948
/* first entry, account for terminating 0 */
1949-
opts->ciphers = malloc(2 * sizeof *opts->ciphers);
1949+
opts->ciphers = malloc(2 * sizeof *cipher_id);
19501950
NC_CHECK_ERRMEM_RET(!opts->ciphers, 1);
19511951
((int *)opts->ciphers)[0] = cipher_id;
19521952
opts->cipher_count = 1;
19531953
} else {
19541954
/* +2 because of terminating 0 */
1955-
opts->ciphers = nc_realloc(opts->ciphers, (opts->cipher_count + 2) * sizeof *opts->ciphers);
1955+
opts->ciphers = nc_realloc(opts->ciphers, (opts->cipher_count + 2) * sizeof *cipher_id);
19561956
NC_CHECK_ERRMEM_RET(!opts->ciphers, 1);
19571957
((int *)opts->ciphers)[opts->cipher_count] = cipher_id;
19581958
opts->cipher_count++;

0 commit comments

Comments
 (0)