fix out of range access to attribute string
Merge pull request #764 from MartinNowak/fixRangeError

fix out of range access to attribute string