xml_parser: check array length index before accessing the array.
Merge pull request #984 from orbitcowboy/master

xml_parser: check array length index before accessing the array.