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

Commit0d99c95

Browse files
committed
Correct potential infinite loop in pg_utf2wchar_with_len;
it failed to cover the case where high bits of char are 100 or 101.Not sure if fix is right, but it agrees with pg_utf_mblen ... and itdoesn't lock up ...
1 parent2acfc4f commit0d99c95

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* conversion functions between pg_wchar and multi-byte streams.
33
* Tatsuo Ishii
4-
* $Id: wchar.c,v 1.6 1999/03/24 07:02:17 ishii Exp $
4+
* $Id: wchar.c,v 1.7 1999/04/25 20:35:51 tgl Exp $
55
*/
66

77
#include"mb/pg_wchar.h"
@@ -268,6 +268,11 @@ pg_utf2wchar_with_len(const unsigned char *from, pg_wchar * to, int len)
268268
*to |=c2 <<6;
269269
*to |=c3;
270270
}
271+
else
272+
{
273+
*to=*from++;
274+
len--;
275+
}
271276
to++;
272277
}
273278
*to=0;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp