vala r2375 - in trunk: . vapigen
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r2375 - in trunk: . vapigen
- Date: Sat, 17 Jan 2009 17:07:13 +0000 (UTC)
Author: juergbi
Date: Sat Jan 17 17:07:13 2009
New Revision: 2375
URL: http://svn.gnome.org/viewvc/vala?rev=2375&view=rev
Log:
2009-01-17 JÃrg Billeter <j bitron ch>
* vapigen/valamarkupreader.vala:
Fix infinite loop when reading entity references
Modified:
trunk/ChangeLog
trunk/vapigen/valamarkupreader.vala
Modified: trunk/vapigen/valamarkupreader.vala
==============================================================================
--- trunk/vapigen/valamarkupreader.vala (original)
+++ trunk/vapigen/valamarkupreader.vala Sat Jan 17 17:07:13 2009
@@ -153,17 +153,14 @@
current++;
char* attr_begin = current;
while (current < end && current[0] != '"') {
- if (current[0] == '&') {
- // process & > < " '
+ unichar u = ((string) current).get_char_validated ((long) (end - current));
+ if (u != (unichar) (-1)) {
+ current += u.to_utf8 (null);
} else {
- unichar u = ((string) current).get_char_validated ((long) (end - current));
- if (u != (unichar) (-1)) {
- current += u.to_utf8 (null);
- } else {
- Report.error (null, "invalid UTF-8 character");
- }
+ Report.error (null, "invalid UTF-8 character");
}
}
+ // TODO process & > < " '
string attr_value = ((string) attr_begin).ndup (current - attr_begin);
if (current >= end || current[0] != '"') {
// error
@@ -188,15 +185,11 @@
space ();
char* text_begin = current;
while (current < end && current[0] != '<') {
- if (current[0] == '&') {
- // process & > < " '
+ unichar u = ((string) current).get_char_validated ((long) (end - current));
+ if (u != (unichar) (-1)) {
+ current += u.to_utf8 (null);
} else {
- unichar u = ((string) current).get_char_validated ((long) (end - current));
- if (u != (unichar) (-1)) {
- current += u.to_utf8 (null);
- } else {
- Report.error (null, "invalid UTF-8 character");
- }
+ Report.error (null, "invalid UTF-8 character");
}
}
if (text_begin == current) {
@@ -205,6 +198,7 @@
return read_token (out token_begin, out token_end);
}
type = MarkupTokenType.TEXT;
+ // TODO process & > < " '
// string text = ((string) text_begin).ndup (current - text_begin);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]