diff options
| author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2026-03-07 13:24:34 +0100 |
|---|---|---|
| committer | Sander Vrijders <sander@ouroboros.rocks> | 2026-03-14 11:23:52 +0100 |
| commit | 4b76e15279792331f886cf756b825fb1e7a1c9ba (patch) | |
| tree | b46e7fff75cb8d1acdbe618c59e03d61d1a4507c /src/lib | |
| parent | a6b629a8c5e13c877a03a59042d188f929d5740a (diff) | |
| download | ouroboros-4b76e15279792331f886cf756b825fb1e7a1c9ba.tar.gz ouroboros-4b76e15279792331f886cf756b825fb1e7a1c9ba.zip | |
lib: Fix initialization when listing names
Now uses calloc to zero the previously uninitialized security path
fields. Also fixes a check in protobuf.c
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/irm.c | 2 | ||||
| -rw-r--r-- | src/lib/protobuf.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/irm.c b/src/lib/irm.c index 594014f7..c62701aa 100644 --- a/src/lib/irm.c +++ b/src/lib/irm.c @@ -614,7 +614,7 @@ ssize_t irm_list_names(struct name_info ** names) return 0; } - *names = malloc(nr * sizeof(**names)); + *names = calloc(nr, sizeof(**names)); if (*names == NULL) { irm_msg__free_unpacked(recv_msg, NULL); return -ENOMEM; diff --git a/src/lib/protobuf.c b/src/lib/protobuf.c index d419a9f1..77f06032 100644 --- a/src/lib/protobuf.c +++ b/src/lib/protobuf.c @@ -137,7 +137,7 @@ name_info_msg_t * name_info_s_to_msg(const struct name_info * info) goto fail_msg; msg->ckey = strdup(info->c.key); - if (msg->skey == NULL) + if (msg->ckey == NULL) goto fail_msg; msg->ccrt = strdup(info->c.crt); |
