TinyCBOR release 0.4.1

This is a bug-fix release. There is no new functionality on top of

Bugs fixed:
 - #54 Failure to build with newest cJSON upstream
 - Stack corruption when memcpy doesn't use the same calling convention
 - Warnings with GCC -pedantic in cbor.h
 - a number of buildsystem bugs

Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
Fix stack corruption due to calling convention mismatch

Standard library implementations may specify calling convention for memcpy
explicitly. However, the cbor* APIs don't do that. If you compile the lib
with default calling convention that doesn't match the calling convention o
memcpy(), the iterate_string_chunks() will not setup the stack for memcpy()
call correctly resulting in a stack corruption. The compiler doesn't catch
this issue because of the cast that is being applied when passing memcpy()
to the iterate_string_chunks().

The fix is to wrap memcpy() in a function that conforms to the declaration o
the IterateFunction which does two things, removes the need for a cast and
uncouples memcpy() calling convention from the rest of the cbor* APIs.

Signed-off-by: Alex Radutskiy (alex.radutskiy@microsoft.com)
Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
1 file changed