Commit Graph
4 Commits
Author SHA1 Message Date
Thiago Macieira 2085ad872e Add initial support for building with Visual Studio
cbortojson.c uses open_memstream for part of its functionality, which
isn't available with the Microsoft CRT, so it's excluded.

Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
2016-06-07 17:43:02 -07:00
Thiago Macieira cd724957e1 Use libtinycbor.a from the unit tests too
We then avoid recompiling every time. Exceptions:
 - tst_parser requires a recursion limit set
 - tst_cpp #includes so that the sources are compiled as C++

Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
2015-09-16 12:11:20 -07:00
Thiago Macieira 4a99af92dc Implement the recursion limit in the CBOR decoder API
It's very easy for a short packet to contain a very high number of
nested arrays (a packet with N bytes can be N-1 nested arrays), which
could cause stack overflow problems in devices using
cbor_value_map_find_value, so ensure that we won't crash.

The actual value needs to be chosen by the implementor depending on the
stack size of their devices and the expected usage.

Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
2015-05-12 17:45:37 +09:00
Thiago Macieira a43a4efc8d Make the CBOR decoder API begin to work
This commit also starts to add unit tests.

The API, as tested, works. The simplereader.c example is probably broken
and will be fixed later.

Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
2015-05-12 17:45:36 +09:00