diff options
| author | tb <> | 2025-06-15 15:58:56 +0000 |
|---|---|---|
| committer | tb <> | 2025-06-15 15:58:56 +0000 |
| commit | 5f37d81f37a451ed3f9dc8f684e6e2df91f6e465 (patch) | |
| tree | 9fa3a3600b96fea27308b7dc799b3957f6706c69 /src | |
| parent | cd96649c134a17d9b107e4625c64cd54e40d0dff (diff) | |
| download | openbsd-5f37d81f37a451ed3f9dc8f684e6e2df91f6e465.tar.gz openbsd-5f37d81f37a451ed3f9dc8f684e6e2df91f6e465.tar.bz2 openbsd-5f37d81f37a451ed3f9dc8f684e6e2df91f6e465.zip | |
crypto_ex_data: use same sizeof idiom as everywhere else in our own code
ok beck
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/crypto_ex_data.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/lib/libcrypto/crypto_ex_data.c b/src/lib/libcrypto/crypto_ex_data.c index b195bbd223..233905f888 100644 --- a/src/lib/libcrypto/crypto_ex_data.c +++ b/src/lib/libcrypto/crypto_ex_data.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: crypto_ex_data.c,v 1.5 2025/06/07 04:37:01 tb Exp $ */ | 1 | /* $OpenBSD: crypto_ex_data.c,v 1.6 2025/06/15 15:58:56 tb Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2023 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2023 Joel Sing <jsing@openbsd.org> |
| 4 | * | 4 | * |
| @@ -100,11 +100,10 @@ CRYPTO_get_ex_new_index(int class_index, long argl, void *argp, | |||
| 100 | goto err; | 100 | goto err; |
| 101 | 101 | ||
| 102 | if ((class = classes[class_index]) == NULL) { | 102 | if ((class = classes[class_index]) == NULL) { |
| 103 | if ((new_class = calloc(1, | 103 | if ((new_class = calloc(1, sizeof(*new_class))) == NULL) |
| 104 | sizeof(struct crypto_ex_data_class))) == NULL) | ||
| 105 | goto err; | 104 | goto err; |
| 106 | if ((new_class->indexes = calloc(CRYPTO_EX_DATA_MAX_INDEX, | 105 | if ((new_class->indexes = calloc(CRYPTO_EX_DATA_MAX_INDEX, |
| 107 | sizeof(struct crypto_ex_data_index *))) == NULL) | 106 | sizeof(*new_class->indexes))) == NULL) |
| 108 | goto err; | 107 | goto err; |
| 109 | new_class->indexes_len = CRYPTO_EX_DATA_MAX_INDEX; | 108 | new_class->indexes_len = CRYPTO_EX_DATA_MAX_INDEX; |
| 110 | new_class->next_index = 1; | 109 | new_class->next_index = 1; |
| @@ -119,7 +118,7 @@ CRYPTO_get_ex_new_index(int class_index, long argl, void *argp, | |||
| 119 | class = classes[class_index]; | 118 | class = classes[class_index]; |
| 120 | } | 119 | } |
| 121 | 120 | ||
| 122 | if ((index = calloc(1, sizeof(struct crypto_ex_data_index))) == NULL) | 121 | if ((index = calloc(1, sizeof(*index))) == NULL) |
| 123 | goto err; | 122 | goto err; |
| 124 | 123 | ||
| 125 | index->new_func = new_func; | 124 | index->new_func = new_func; |
| @@ -200,12 +199,12 @@ crypto_ex_data_init(CRYPTO_EX_DATA *exdata) | |||
| 200 | if (exdata->sk != NULL) | 199 | if (exdata->sk != NULL) |
| 201 | goto err; | 200 | goto err; |
| 202 | 201 | ||
| 203 | if ((ced = calloc(1, sizeof(struct crypto_ex_data))) == NULL) | 202 | if ((ced = calloc(1, sizeof(*ced))) == NULL) |
| 204 | goto err; | 203 | goto err; |
| 205 | 204 | ||
| 206 | ced->class_index = -1; | 205 | ced->class_index = -1; |
| 207 | 206 | ||
| 208 | if ((ced->slots = calloc(CRYPTO_EX_DATA_MAX_INDEX, sizeof(void *))) == NULL) | 207 | if ((ced->slots = calloc(CRYPTO_EX_DATA_MAX_INDEX, sizeof(*ced->slots))) == NULL) |
| 209 | goto err; | 208 | goto err; |
| 210 | ced->slots_len = CRYPTO_EX_DATA_MAX_INDEX; | 209 | ced->slots_len = CRYPTO_EX_DATA_MAX_INDEX; |
| 211 | 210 | ||
