Group :: Databases
RPM: postgresql11
Main Changelog Spec Patches Sources Download Gear Bugs and FR Repocop
Patch: 0006-Workaround-for-will-always-overflow-destination-buff.patch
Download
Download
From 67d17cdbcefa7ff84aa66c02ac7b905ce6f7d007 Mon Sep 17 00:00:00 2001
From: Konstantin Pavlov <thresh@altlinux.org>
Date: Thu, 4 Mar 2010 11:51:56 +0300
Subject: [PATCH 6/7] Workaround for "will always overflow destination buffer" error.
---
postgresql/contrib/pg_trgm/trgm_op.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/postgresql/contrib/pg_trgm/trgm_op.c b/postgresql/contrib/pg_trgm/trgm_op.c
index 19b6747..f866f58 100644
--- a/postgresql/contrib/pg_trgm/trgm_op.c
+++ b/postgresql/contrib/pg_trgm/trgm_op.c
@@ -266,7 +266,10 @@ show_trgm(PG_FUNCTION_ARGS)
if (pg_database_encoding_max_length() > 1 && !ISPRINTABLETRGM(ptr))
{
- snprintf(VARDATA(item), 12, "0x%06x", trgm2int(ptr));
+ char buffer[12];
+ memset(buffer, 0, 12);
+ snprintf(buffer, 11, "0x%06x", trgm2int(ptr));
+ strcpy(VARDATA(item), buffer);
SET_VARSIZE(item, VARHDRSZ + strlen(VARDATA(item)));
}
else
--
1.6.6.2