Proper bound check in _bfd_doprnt_scan
authorAlan Modra <amodra@gmail.com>
Sun, 5 Nov 2017 09:22:13 +0000 (19:52 +1030)
committerAlan Modra <amodra@gmail.com>
Sun, 5 Nov 2017 11:18:08 +0000 (21:48 +1030)
commit26a9301057457ae576b51b8127bb805b4e484a6b
tree02daecfaef5312504b4e5ac4c2ed374be6309a63
parent7167fe4c70ea74f1bb74a6130bb7e6bf5ca354ee
Proper bound check in _bfd_doprnt_scan

While an abort after storing out of bounds by one to an array in our
caller is probably OK in practice, it's better to check before storing.

PR 22397
* bfd.c (_bfd_doprnt_scan): Check args index before storing, not
after.
bfd/ChangeLog
bfd/bfd.c