summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Naylor2021-07-21 13:11:32 +0000
committerJohn Naylor2021-07-21 13:11:32 +0000
commit004874b72e8e60966f88de2d95667fe66c0466ca (patch)
tree5acba2034335c3cabe8e204b59951d6c859c98bb
parent983bdc4fac492a99bb8ab5a471ca7437139e5cf6 (diff)
Add missing check of noError parameter in euc_tw_and_big5.c
Oversight in ea1b99a66 Yukun Wang Backpatch to v14 where this parameter was introduced Discussion: https://www.postgresql.org/message-id/flat/OS0PR01MB6003FCEFF0201EF21685FD33B4E39%40OS0PR01MB6003.jpnprd01.prod.outlook.com
-rw-r--r--src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c b/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c
index 4bf8acda99..e9f1d61af8 100644
--- a/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c
+++ b/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c
@@ -286,8 +286,12 @@ big52euc_tw(const unsigned char *big5, unsigned char *p, int len, bool noError)
{
/* ASCII */
if (c1 == 0)
+ {
+ if (noError)
+ break;
report_invalid_encoding(PG_BIG5,
(const char *) big5, len);
+ }
*p++ = c1;
big5++;
len--;