projects
/
yaz-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
48e3b97
)
Prevent XML CDATA with ASCII control chars (except TAB,CR,LF)
author
Adam Dickmeiss
<adam@indexdata.dk>
Fri, 1 Oct 2004 11:44:46 +0000
(11:44 +0000)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Fri, 1 Oct 2004 11:44:46 +0000
(11:44 +0000)
src/wrbuf.c
patch
|
blob
|
history
diff --git
a/src/wrbuf.c
b/src/wrbuf.c
index
0b92aea
..
345a33e
100644
(file)
--- a/
src/wrbuf.c
+++ b/
src/wrbuf.c
@@
-2,7
+2,7
@@
* Copyright (c) 1995-2004, Index Data.
* See the file LICENSE for details.
*
* Copyright (c) 1995-2004, Index Data.
* See the file LICENSE for details.
*
- * $Id: wrbuf.c,v 1.4 2004-03-20 07:02:23 adam Exp $
+ * $Id: wrbuf.c,v 1.5 2004-10-01 11:44:46 adam Exp $
*/
/*
*/
/*
@@
-89,6
+89,13
@@
int wrbuf_xmlputs_n(WRBUF b, const char *cp, int size)
{
while (--size >= 0)
{
{
while (--size >= 0)
{
+ /* only TAB,CR,LF of ASCII CTRL are allowed in XML 1.0! */
+ if (*cp >= 0 && *cp <= 31)
+ if (*cp != 9 && *cp != 10 && *cp != 13)
+ {
+ cp++; /* we silently ignore (delete) these.. */
+ continue;
+ }
switch(*cp)
{
case '<':
switch(*cp)
{
case '<':