diff --git a/src/encauth/siv/siv.c b/src/encauth/siv/siv.c index bd6d5b45..4de52d90 100644 --- a/src/encauth/siv/siv.c +++ b/src/encauth/siv/siv.c @@ -161,7 +161,7 @@ static LTC_INLINE int s_siv_S2V_T(siv_omac_ctx_t *ctx, } else { s_siv_dbl(D); XMEMSET(&T, 0, sizeof(T)); - XMEMCPY(&T, in, inlen); + if (inlen != 0) XMEMCPY(&T, in, inlen); T.u.byte[inlen] = 0x80; s_siv_xor_buf(D, &T); diff --git a/src/misc/compare_testvector.c b/src/misc/compare_testvector.c index f1308496..874794ff 100644 --- a/src/misc/compare_testvector.c +++ b/src/misc/compare_testvector.c @@ -59,6 +59,8 @@ int ltc_compare_testvector(const void* is, const unsigned long is_len, const voi int res = 0; if(is_len != should_len) { res = is_len > should_len ? -1 : 1; + } else if (is_len == 0) { + res = 0; } else { res = XMEMCMP(is, should, is_len); }