Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
cad98399
Kaydet (Commit)
cad98399
authored
May 25, 2012
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
stop parsing on encountering internal entities in fastparser.cxx
üst
fe226fd8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
0 deletions
+40
-0
fastparser.cxx
sax/source/fastparser/fastparser.cxx
+36
-0
fastparser.hxx
sax/source/fastparser/fastparser.hxx
+4
-0
No files found.
sax/source/fastparser/fastparser.cxx
Dosyayı görüntüle @
cad98399
...
...
@@ -130,6 +130,16 @@ static void call_callbackCharacters( void *userData , const XML_Char *s , int nL
pFastParser
->
callbackCharacters
(
s
,
nLen
);
}
static
void
call_callbackEntityDecl
(
void
*
userData
,
const
XML_Char
*
entityName
,
int
is_parameter_entity
,
const
XML_Char
*
value
,
int
value_length
,
const
XML_Char
*
base
,
const
XML_Char
*
systemId
,
const
XML_Char
*
publicId
,
const
XML_Char
*
notationName
)
{
FastSaxParser
*
pFastParser
=
reinterpret_cast
<
FastSaxParser
*>
(
userData
);
pFastParser
->
callbackEntityDecl
(
entityName
,
is_parameter_entity
,
value
,
value_length
,
base
,
systemId
,
publicId
,
notationName
);
}
static
int
call_callbackExternalEntityRef
(
XML_Parser
parser
,
const
XML_Char
*
openEntityNames
,
const
XML_Char
*
base
,
const
XML_Char
*
systemId
,
const
XML_Char
*
publicId
)
{
...
...
@@ -458,6 +468,7 @@ void FastSaxParser::parseStream( const InputSource& maStructSource) throw (SAXEx
XML_SetUserData
(
entity
.
mpParser
,
this
);
XML_SetElementHandler
(
entity
.
mpParser
,
call_callbackStartElement
,
call_callbackEndElement
);
XML_SetCharacterDataHandler
(
entity
.
mpParser
,
call_callbackCharacters
);
XML_SetEntityDeclHandler
(
entity
.
mpParser
,
call_callbackEntityDecl
);
XML_SetExternalEntityRefHandler
(
entity
.
mpParser
,
call_callbackExternalEntityRef
);
pushEntity
(
entity
);
...
...
@@ -887,6 +898,31 @@ void FastSaxParser::callbackCharacters( const XML_Char* s, int nLen )
}
}
void
FastSaxParser
::
callbackEntityDecl
(
SAL_UNUSED_PARAMETER
const
XML_Char
*
/*entityName*/
,
SAL_UNUSED_PARAMETER
int
/*is_parameter_entity*/
,
const
XML_Char
*
value
,
SAL_UNUSED_PARAMETER
int
/*value_length*/
,
SAL_UNUSED_PARAMETER
const
XML_Char
*
/*base*/
,
SAL_UNUSED_PARAMETER
const
XML_Char
*
/*systemId*/
,
SAL_UNUSED_PARAMETER
const
XML_Char
*
/*publicId*/
,
SAL_UNUSED_PARAMETER
const
XML_Char
*
/*notationName*/
)
{
if
(
value
)
{
// value != 0 means internal entity
OSL_TRACE
(
"FastSaxParser: internal entity declaration, stopping"
);
XML_StopParser
(
getEntity
().
mpParser
,
XML_FALSE
);
getEntity
().
maSavedException
<<=
SAXParseException
(
::
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"FastSaxParser: internal entity declaration, stopping"
)),
static_cast
<
OWeakObject
*>
(
this
),
Any
(),
mxDocumentLocator
->
getPublicId
(),
mxDocumentLocator
->
getSystemId
(),
mxDocumentLocator
->
getLineNumber
(),
mxDocumentLocator
->
getColumnNumber
()
);
}
else
{
OSL_TRACE
(
"FastSaxParser: ignoring external entity declaration"
);
}
}
int
FastSaxParser
::
callbackExternalEntityRef
(
XML_Parser
parser
,
const
XML_Char
*
context
,
SAL_UNUSED_PARAMETER
const
XML_Char
*
/*base*/
,
const
XML_Char
*
systemId
,
...
...
sax/source/fastparser/fastparser.hxx
Dosyayı görüntüle @
cad98399
...
...
@@ -127,6 +127,10 @@ public:
void
callbackEndElement
(
const
XML_Char
*
name
);
void
callbackCharacters
(
const
XML_Char
*
s
,
int
nLen
);
int
callbackExternalEntityRef
(
XML_Parser
parser
,
const
XML_Char
*
openEntityNames
,
const
XML_Char
*
base
,
const
XML_Char
*
systemId
,
const
XML_Char
*
publicId
);
void
callbackEntityDecl
(
const
XML_Char
*
entityName
,
int
is_parameter_entity
,
const
XML_Char
*
value
,
int
value_length
,
const
XML_Char
*
base
,
const
XML_Char
*
systemId
,
const
XML_Char
*
publicId
,
const
XML_Char
*
notationName
);
inline
void
pushEntity
(
const
Entity
&
rEntity
)
{
maEntities
.
push
(
rEntity
);
}
inline
void
popEntity
()
{
maEntities
.
pop
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment