From 9931fbf1d657b48da7c183f942ef033e54fe22a4 Mon Sep 17 00:00:00 2001 From: Rahim Kanji Date: Fri, 3 Oct 2025 16:03:02 +0500 Subject: [PATCH] Replace 0xFFFFFFFF with PGSQL_PARAM_NULL constant --- include/PgSQL_Extended_Query_Message.h | 3 +-- lib/PgSQL_Extended_Query_Message.cpp | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/PgSQL_Extended_Query_Message.h b/include/PgSQL_Extended_Query_Message.h index c453c2908..4ab3ae3f6 100644 --- a/include/PgSQL_Extended_Query_Message.h +++ b/include/PgSQL_Extended_Query_Message.h @@ -4,6 +4,7 @@ #include "proxysql.h" #include "cpp.h" +constexpr uint32_t PGSQL_PARAM_NULL = 0xFFFFFFFFu; /** * @brief Base class for handling PostgreSQL extended query messages. @@ -172,8 +173,6 @@ public: } current += sizeof(uint32_t); - constexpr uint32_t PGSQL_PARAM_NULL = 0xFFFFFFFF; - if (len != PGSQL_PARAM_NULL && len > INT32_MAX) { return false; // Malformed: length does not fit into int32_t } diff --git a/lib/PgSQL_Extended_Query_Message.cpp b/lib/PgSQL_Extended_Query_Message.cpp index 6f4a34d6e..375a6a1b0 100644 --- a/lib/PgSQL_Extended_Query_Message.cpp +++ b/lib/PgSQL_Extended_Query_Message.cpp @@ -379,7 +379,7 @@ bool PgSQL_Bind_Message::parse(PtrSize_t& pkt) { return false; } offset += sizeof(uint32_t); - if (param_value_len != 0xFFFFFFFF) { + if (param_value_len != PGSQL_PARAM_NULL) { // Ensure the parameter value size is valid if (offset + param_value_len > pkt_len) return false;