From 08c82ddbb5ea412be53edfa419eae76432b4d8b6 Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Tue, 25 Jun 2024 12:10:35 -0500 Subject: [PATCH] Fix possible segfault in 2038 testing --- src/misc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/misc.c b/src/misc.c index 2e6c5aef6..4b4398230 100644 --- a/src/misc.c +++ b/src/misc.c @@ -3109,7 +3109,7 @@ int rig_test_2038(RIG *rig) return 1; } - if (strstr(s, "2097")) { return RIG_OK; } + if (s != NULL && strstr(s, "2097")) { return RIG_OK; } #if defined(__MSVCRT_VERSION__) _ctime64_s(s, sizeof(s), &x); @@ -3117,7 +3117,7 @@ int rig_test_2038(RIG *rig) s = ctime(&x); #endif - if (strstr(s, "2097")) { return RIG_OK; } + if (s != NULL && strstr(s, "2097")) { return RIG_OK; } return 1; }