From 042825fa315a96e6e6741419514767b2c37a0d02 Mon Sep 17 00:00:00 2001 From: "David M. Syzdek" Date: Wed, 11 Jan 2023 10:55:17 -0900 Subject: libotputil: fixing NULL dereferencing in otputil_skey_cmp() --- lib/libotputil/lrfc1760-skey.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib') diff --git a/lib/libotputil/lrfc1760-skey.c b/lib/libotputil/lrfc1760-skey.c index f152cd4..62e5d5e 100644 --- a/lib/libotputil/lrfc1760-skey.c +++ b/lib/libotputil/lrfc1760-skey.c @@ -93,6 +93,8 @@ otputil_skey_cmp( size_t x_len = ((x)) ? strlen(x) : 0; size_t y_len = ((y)) ? strlen(y) : 0; + if ( (!(x)) && (!(y)) ) + return(0); if ( ((x)) && (!(y)) ) return(-1); if ( (!(x)) && ((y)) ) -- cgit v1.2.3