commit f5754dc907aa1afa7015fe0e5767a528feb10ec1
parent ee06255f86af9126354ae48ab3a19f094406513f
Author: lash <dev@holbrook.no>
Date: Mon, 29 Apr 2024 17:58:53 +0100
Add null terminator to uoa string val
Diffstat:
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/ledger.c b/src/ledger.c
@@ -452,7 +452,7 @@ int kee_ledger_serialize(struct kee_ledger_t *ledger, char *out, size_t *out_len
return ERR_FAIL;
}
- c = strlen(ledger->uoa);
+ c = strlen(ledger->uoa) + 1;
r = asn1_write_value(node, "Kee.KeeEntryHead.uoa", ledger->uoa, c);
if (r != ASN1_SUCCESS) {
return r;
diff --git a/src/tests/ledger.c b/src/tests/ledger.c
@@ -391,7 +391,7 @@ int test_pair() {
return 1;
}
- if (memcmp(ledger.uoa, "USD", 3)) {
+ if (strcmp(ledger.uoa, "USD")) {
return 1;
}