projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d558c9f
)
Fix utf8-non-encoding in xml-escape
author
Wilfried Goesgens
<dothebart@citadel.org>
Mon, 16 Feb 2015 19:35:57 +0000
(20:35 +0100)
committer
Wilfried Goesgens
<dothebart@citadel.org>
Mon, 16 Feb 2015 19:37:42 +0000
(20:37 +0100)
libcitadel/lib/stringbuf.c
patch
|
blob
|
history
diff --git
a/libcitadel/lib/stringbuf.c
b/libcitadel/lib/stringbuf.c
index baa9c69a79ea8a5df0e58e8e2096a93a567f8f0f..134ff47794a32e8790522a25d75a3e80b1bff960 100644
(file)
--- a/
libcitadel/lib/stringbuf.c
+++ b/
libcitadel/lib/stringbuf.c
@@
-2006,32
+2006,13
@@
void StrBufXMLEscAppend(StrBuf *OutBuf,
*pt = *pch;
pt++; pch++;
}
*pt = *pch;
pt++; pch++;
}
- else if (*pch < 0x20) {
- /* we probably shouldn't be doing this */
- if (OverrideLowChars)
- {
- *pt = '_';
- pt ++;
- pch ++;
- }
- else
- {
- *pt = '&';
- pt++;
- *pt = HexList[*(unsigned char*)pch][0];
- pt ++;
- *pt = HexList[*(unsigned char*)pch][1];
- pt ++; pch ++;
- *pt = '&';
- pt++;
- pch ++;
- }
- }
else {
IsUtf8Sequence = Ctdl_GetUtf8SequenceLength(pch, pche);
if (IsUtf8Sequence)
{
else {
IsUtf8Sequence = Ctdl_GetUtf8SequenceLength(pch, pche);
if (IsUtf8Sequence)
{
- while (IsUtf8Sequence > 0){
+ while ((IsUtf8Sequence > 0) &&
+ (pch < pche))
+ {
*pt = *pch;
pt ++;
pch ++;
*pt = *pch;
pt ++;
pch ++;