From 7cdd3bbe658c9f6b296feda84adc5152d922408c Mon Sep 17 00:00:00 2001 From: AlomeProg Date: Sun, 13 Jul 2025 14:34:58 +0300 Subject: [PATCH 1/6] fix virtual destructors to IntlParametersBlock hierarchy. --- src/common/IntlParametersBlock.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/common/IntlParametersBlock.h b/src/common/IntlParametersBlock.h index bc080496dc2..218e39470af 100644 --- a/src/common/IntlParametersBlock.h +++ b/src/common/IntlParametersBlock.h @@ -44,6 +44,8 @@ class IntlParametersBlock virtual TagType checkTag(UCHAR tag, const char** tagName) = 0; virtual UCHAR getUtf8Tag() = 0; + virtual ~IntlParametersBlock() = default; + void toUtf8(ClumpletWriter& pb); void fromUtf8(ClumpletWriter& pb); @@ -56,6 +58,8 @@ class IntlDpb : public IntlParametersBlock public: TagType checkTag(UCHAR tag, const char** tagName); UCHAR getUtf8Tag(); + + ~IntlDpb() override = default; }; class IntlSpb : public IntlParametersBlock @@ -63,6 +67,8 @@ class IntlSpb : public IntlParametersBlock public: TagType checkTag(UCHAR tag, const char** tagName); UCHAR getUtf8Tag(); + + ~IntlSpb() override = default; }; class IntlSpbStart : public IntlParametersBlock @@ -75,6 +81,8 @@ class IntlSpbStart : public IntlParametersBlock TagType checkTag(UCHAR tag, const char** tagName); UCHAR getUtf8Tag(); + ~IntlSpbStart() override = default; + private: UCHAR mode; }; From ff4e6fdd01dfce3c8c806fced7b4b6251f380568 Mon Sep 17 00:00:00 2001 From: AlomeProg Date: Sun, 13 Jul 2025 14:39:14 +0300 Subject: [PATCH 2/6] fixed false positive null pointer dereference warnings by adding a check --- src/common/classes/Hash.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/classes/Hash.h b/src/common/classes/Hash.h index fe7b3cc9d36..dda4a998362 100644 --- a/src/common/classes/Hash.h +++ b/src/common/classes/Hash.h @@ -103,6 +103,7 @@ namespace Firebird void link(Entry** where) { + fb_assert(where != nullptr); unLink(); // set our pointers From 34f091af1c278da4728e3d7c42b4b21889b245e9 Mon Sep 17 00:00:00 2001 From: AlomeProg Date: Mon, 14 Jul 2025 23:33:24 +0300 Subject: [PATCH 3/6] fixed CodeChecker warnings by adding parentheses --- src/yvalve/gds.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/yvalve/gds.cpp b/src/yvalve/gds.cpp index fdfe5099fb5..99108e64998 100644 --- a/src/yvalve/gds.cpp +++ b/src/yvalve/gds.cpp @@ -2657,7 +2657,7 @@ void API_ROUTINE gds__unregister_cleanup(FPTR_VOID_PTR routine, void *arg) Firebird::MutexLockGuard guard(cleanup_handlers_mutex, "gds__unregister_cleanup"); clean_t* clean; - for (clean_t** clean_ptr = &cleanup_handlers; clean = *clean_ptr; clean_ptr = &clean->clean_next) + for (clean_t** clean_ptr = &cleanup_handlers; (clean = *clean_ptr); clean_ptr = &clean->clean_next) { if (clean->clean_routine == routine && clean->clean_arg == arg) { From 454809f7f8393cef9b61b0ee13d2e7b331316934 Mon Sep 17 00:00:00 2001 From: AlomeProg Date: Mon, 14 Jul 2025 23:59:19 +0300 Subject: [PATCH 4/6] fix missing virtual destructor in class "Transliterate" --- src/common/classes/BatchCompletionState.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/classes/BatchCompletionState.h b/src/common/classes/BatchCompletionState.h index c8de5d5c0e4..391867c4da4 100644 --- a/src/common/classes/BatchCompletionState.h +++ b/src/common/classes/BatchCompletionState.h @@ -34,6 +34,7 @@ namespace Firebird { { public: virtual void transliterate(IStatus* status) = 0; + virtual ~Transliterate() = default; }; class BatchCompletionState final : From 4f5dbbbde88132b07451140025cc0807f9e38ee3 Mon Sep 17 00:00:00 2001 From: AlomeProg Date: Tue, 15 Jul 2025 00:03:46 +0300 Subject: [PATCH 5/6] fix CodeChecker warnings with the flag correction for pthread. --- src/common/ThreadStart.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/ThreadStart.cpp b/src/common/ThreadStart.cpp index 8496ff22595..0760ad19acc 100644 --- a/src/common/ThreadStart.cpp +++ b/src/common/ThreadStart.cpp @@ -181,7 +181,7 @@ Thread Thread::start(ThreadEntryPoint* routine, void* arg, int priority_arg, Han { #ifdef HAVE_PTHREAD_CANCEL int dummy; // We do not want to know old cancel type - state = pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &dummy); + state = pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &dummy); if (state) Firebird::system_call_failed::raise("pthread_setcanceltype", state); #endif From e4a90ffe5f8ac2a77015807b0c5b6eb18021a46e Mon Sep 17 00:00:00 2001 From: AlomeProg Date: Tue, 15 Jul 2025 13:53:00 +0300 Subject: [PATCH 6/6] fix removed unnecessary destructors --- src/common/IntlParametersBlock.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/common/IntlParametersBlock.h b/src/common/IntlParametersBlock.h index 218e39470af..59964ed5dd0 100644 --- a/src/common/IntlParametersBlock.h +++ b/src/common/IntlParametersBlock.h @@ -58,8 +58,6 @@ class IntlDpb : public IntlParametersBlock public: TagType checkTag(UCHAR tag, const char** tagName); UCHAR getUtf8Tag(); - - ~IntlDpb() override = default; }; class IntlSpb : public IntlParametersBlock @@ -67,8 +65,6 @@ class IntlSpb : public IntlParametersBlock public: TagType checkTag(UCHAR tag, const char** tagName); UCHAR getUtf8Tag(); - - ~IntlSpb() override = default; }; class IntlSpbStart : public IntlParametersBlock @@ -80,9 +76,6 @@ class IntlSpbStart : public IntlParametersBlock TagType checkTag(UCHAR tag, const char** tagName); UCHAR getUtf8Tag(); - - ~IntlSpbStart() override = default; - private: UCHAR mode; };