projects
/
users
/
bernd
/
postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
804d9e6
)
Correct potential infinite loop in pg_utf2wchar_with_len;
author
Tom Lane
<tgl@sss.pgh.pa.us>
Sun, 25 Apr 1999 20:35:51 +0000
(20:35 +0000)
committer
Tom Lane
<tgl@sss.pgh.pa.us>
Sun, 25 Apr 1999 20:35:51 +0000
(20:35 +0000)
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 it
doesn't lock up ...
src/backend/utils/mb/wchar.c
patch
|
blob
|
blame
|
history
diff --git
a/src/backend/utils/mb/wchar.c
b/src/backend/utils/mb/wchar.c
index e1de940b96076f392b36ad192afe6b68746fcdff..23e2da8465ff5d43121af50a1690cb220c39b5e6 100644
(file)
--- a/
src/backend/utils/mb/wchar.c
+++ b/
src/backend/utils/mb/wchar.c
@@
-268,6
+268,11
@@
pg_utf2wchar_with_len(const unsigned char *from, pg_wchar * to, int len)
*to |= c2 << 6;
*to |= c3;
}
+ else
+ {
+ *to = *from++;
+ len--;
+ }
to++;
}
*to = 0;