Make sure we don't run off the end of the string when translating entities in attribute values

git-svn-id: svn://10.0.0.236/trunk@8895 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
kipp%netscape.com
1998-08-31 22:00:04 +00:00
parent 8c7e275201
commit cf548d3884
2 changed files with 6 additions and 2 deletions

View File

@@ -290,7 +290,9 @@ GetAttributeValueAt(const nsIParserNode& aNode,
char cbuf[100];
PRInt32 index = 0;
while (index < aResult.Length()) {
if (aResult.CharAt(index++) == '&') {
// If we have the start of an entity (and it's not at the end of
// our string) then translate the entity into it's unicode value.
if ((aResult.CharAt(index++) == '&') && (index < aResult.Length())) {
PRInt32 start = index - 1;
PRUnichar e = aResult.CharAt(index);
if (e == '#') {

View File

@@ -290,7 +290,9 @@ GetAttributeValueAt(const nsIParserNode& aNode,
char cbuf[100];
PRInt32 index = 0;
while (index < aResult.Length()) {
if (aResult.CharAt(index++) == '&') {
// If we have the start of an entity (and it's not at the end of
// our string) then translate the entity into it's unicode value.
if ((aResult.CharAt(index++) == '&') && (index < aResult.Length())) {
PRInt32 start = index - 1;
PRUnichar e = aResult.CharAt(index);
if (e == '#') {