wc-duck / datalibrary

Open Source Data Library for data serialization.
Other
42 stars 8 forks source link

Bad count on pointer patching dynamic arrays. #77

Closed lundmark closed 6 years ago

lundmark commented 6 years ago

The issue is that when pointer patching goes through dynamic arrays, it fetches the count by using uint32_t count = *src; where src is an uint8-pointer.

In order to test this, the array that we need to test on needs to be more than UINT8_MAX count, and that array needs to contain pointers that needs patching in order to encounter an actual issue with the bug.

In order to facilitate the bug-testing I had to rewrite a lot of unit-test functionality to be dynamically allocated buffers with malloc() instead of static buffers. This can probably be cleaned up a bit and optimized.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.09%) to 91.362% when pulling 77330a535ad443eae1ba71bc0b7a3c3934265ad6 on lundmark:master into f186cf69c201c78d38aa220b82287abe365e50f5 on wc-duck:master.