Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0c1e2e4

Browse files
committed
set client_encoding to <nothing> crashes backend.
1 parent507a0a2 commit0c1e2e4

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

‎src/backend/utils/mb/common.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* This file contains some public functions
33
* usable for both the backend and the frontend.
44
* Tatsuo Ishii
5-
* $Id: common.c,v 1.3 1998/10/06 03:02:21 momjian Exp $ */
5+
* $Id: common.c,v 1.4 1999/05/13 10:28:25 ishii Exp $ */
66

77
#include<stdlib.h>
88

@@ -28,6 +28,10 @@ pg_char_to_encoding(const char *s)
2828
{
2929
pg_encoding_conv_tbl*p=pg_conv_tbl;
3030

31+
if (!s) {
32+
return (-1);
33+
}
34+
3135
for (;p->encoding >=0;p++)
3236
{
3337
if (!strcasecmp(s,p->name))

‎src/backend/utils/mb/variable.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* This file contains some public functions
33
* related to show/set/reset variable commands.
44
* Tatsuo Ishii
5-
* $Id: variable.c,v 1.2 1998/09/01 04:33:24 momjian Exp $
5+
* $Id: variable.c,v 1.3 1999/05/13 10:28:26 ishii Exp $
66
*/
77

88
#include"mb/pg_wchar.h"
@@ -13,8 +13,13 @@ parse_client_encoding(const char *value)
1313
intencoding;
1414

1515
encoding=pg_valid_client_encoding(value);
16-
if (encoding<0)
17-
elog(ERROR,"Client encoding %s is not supported",value);
16+
if (encoding<0) {
17+
if (value) {
18+
elog(ERROR,"Client encoding %s is not supported",value);
19+
}else {
20+
elog(ERROR,"No client encoding is specified");
21+
}
22+
}
1823
else
1924
{
2025
if (pg_set_client_encoding(encoding))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp