Fix UBSAN errors

src/encauth/siv/siv.c:164:19: runtime error: null pointer passed as argument 2, which is declared to never be null
/usr/include/string.h:44:28: note: nonnull attribute specified here
src/misc/compare_testvector.c:63:25: runtime error: null pointer passed as argument 2, which is declared to never be null
/usr/include/string.h:65:33: note: nonnull attribute specified here
This commit is contained in:
Marek Knápek 2026-05-20 02:45:00 +02:00 committed by Steffen Jaeckel
parent c5607aff6b
commit 471f143078

View file

@ -59,7 +59,7 @@ 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) {
} else if (is_len == 0 && (!is || !should)) {
res = 0;
} else {
res = XMEMCMP(is, should, is_len);