check for array bounds
Merge branch 'master' into develop