projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
deb90c7
)
fix erroneous utf-16 encoding with surrogates in iconv
author
Rich Felker
<dalias@aerifal.cx>
Tue, 19 Jun 2012 00:29:41 +0000
(20:29 -0400)
committer
Rich Felker
<dalias@aerifal.cx>
Tue, 19 Jun 2012 00:29:41 +0000
(20:29 -0400)
apparently this was never tested before.
src/locale/iconv.c
patch
|
blob
|
history
diff --git
a/src/locale/iconv.c
b/src/locale/iconv.c
index 30a457f3f52be3f130572f976cea84526216508a..c48e45aa325a7e46c8a600f3d0ac580edda3e436 100644
(file)
--- a/
src/locale/iconv.c
+++ b/
src/locale/iconv.c
@@
-336,6
+336,7
@@
size_t iconv(iconv_t cd0, char **in, size_t *inb, char **out, size_t *outb)
}
if (type-UCS2BE < 2U) goto ilseq;
if (*outb < 4) goto toobig;
+ c -= 0x10000;
put_16((void *)*out, (c>>10)|0xd800, totype);
put_16((void *)(*out + 2), (c&0x3ff)|0xdc00, totype);
*out += 4;