Check size before taking substr
Merge branch 'trac-3348-berry-crash-loading-dylibs' into niftk-2013.09