From d055c1e29a0271b746869a74e4d4e5f099eb1c46 Mon Sep 17 00:00:00 2001 From: Rahim Kanji Date: Sun, 18 Aug 2024 14:45:20 +0500 Subject: [PATCH] Few tweaks --- deps/postgresql/handle_row_data.patch | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/deps/postgresql/handle_row_data.patch b/deps/postgresql/handle_row_data.patch index 316e100d3..dec09fe2b 100644 --- a/deps/postgresql/handle_row_data.patch +++ b/deps/postgresql/handle_row_data.patch @@ -60,7 +60,7 @@ diff --git src/interfaces/libpq/fe-protocol3.c src/interfaces/libpq/fe-protocol3 index 9c4aa7e..de0746c 100644 --- src/interfaces/libpq/fe-protocol3.c +++ src/interfaces/libpq/fe-protocol3.c -@@ -2299,3 +2299,102 @@ build_startup_packet(const PGconn *conn, char *packet, +@@ -2299,3 +2299,105 @@ build_startup_packet(const PGconn *conn, char *packet, return packet_len; } @@ -116,8 +116,11 @@ index 9c4aa7e..de0746c 100644 + */ + msgLength -= 4; + avail = conn->inEnd - conn->inCursor; -+ if (avail < msgLength) -+ return EOF; ++ if (avail < msgLength) { ++ if ((conn->inCursor+(size_t)msgLength) <= (size_t)conn->inBufSize) ++ return EOF; ++ return 1; ++ } + + if (conn->result != NULL && + conn->result->resultStatus == PGRES_TUPLES_OK) @@ -180,7 +183,7 @@ index c5170d1..3e3cc34 100644 + char id; + int len; + const char* data; -+ int fieldcount; ++ //int fieldcount; +} PSresult; + /* ----------------