From 1d235139459debd8c1f67606b1a42d8bd39b9bff Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 10 Oct 2023 00:27:56 -0700 Subject: [PATCH] [ntcore] Fix string array value comparison (#5745) It did not correctly check size prior to checking size=0. --- ntcore/src/main/native/cpp/Value.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ntcore/src/main/native/cpp/Value.cpp b/ntcore/src/main/native/cpp/Value.cpp index 537f5ecc4e..09ba775b89 100644 --- a/ntcore/src/main/native/cpp/Value.cpp +++ b/ntcore/src/main/native/cpp/Value.cpp @@ -389,6 +389,9 @@ bool nt::operator==(const Value& lhs, const Value& rhs) { lhs.m_val.data.arr_double.size * sizeof(lhs.m_val.data.arr_double.arr[0])) == 0; case NT_STRING_ARRAY: + if (lhs.m_val.data.arr_string.size != rhs.m_val.data.arr_string.size) { + return false; + } if (lhs.m_val.data.arr_string.size == 0) { return true; }