]> git.saurik.com Git - apple/xnu.git/blobdiff - libkern/c++/OSUnserializeXML.cpp
xnu-3789.1.32.tar.gz
[apple/xnu.git] / libkern / c++ / OSUnserializeXML.cpp
index b694f44ec94d8d84854184bc520c284d9277651d..37c40da4d97fbcf924644e4d61b6e6670bf3f85e 100644 (file)
@@ -2014,6 +2014,7 @@ getTag(parser_state_t *state,
                if (c == '\n') state->lineNumber++;
                if (c != '?') continue;
                c = nextChar();
+               if (!c) return TAG_IGNORE;
                if (c == '>') {
                    (void)nextChar();
                    return TAG_IGNORE;
@@ -2068,6 +2069,7 @@ getTag(parser_state_t *state,
                        values[*attributeCount][length++] = c;
                        if (length >= (TAG_MAX_LENGTH - 1)) return TAG_BAD;
                        c = nextChar();
+                       if (!c) return TAG_BAD;
                }
                values[*attributeCount][length] = 0;