commit | ff34ba3e88cdd2e83e1c95e0356bbf4bef47ae2e | [log] [tgz] |
---|---|---|
author | Nick Wellnhofer <wellnhofer@aevum.de> | Wed May 31 18:53:45 2017 +0200 |
committer | Nick Wellnhofer <wellnhofer@aevum.de> | Thu Jun 01 14:31:28 2017 +0200 |
tree | 30a16ffad0c521474f0bba821015f942367fecf1 | |
parent | 34e445674d5fe7b94b702449ac40d4c0a3ca9d12 [diff] |
Avoid out-of-bound array access in API tests The API tests combine string buffers with arbitrary length values which makes ASan detect out-of-bound array accesses. Even without ASan, this could lead to unwanted test failures. Add a check for "len", "size", and "start" arguments, assuming they apply to the nearest char pointer. Skip the test if they exceed the buffer size. This is a somewhat naive heuristic but it seems to work well.