cose-wg / COSE-C

Implementation of COSE in C++; Provides a C interface; Crypto by openssl or mbedtls
BSD 3-Clause "New" or "Revised" License
30 stars 22 forks source link

Fix incorrect checks of cn_cbor_encoder_write result. #52

Closed sbertin-telular closed 6 years ago

sbertin-telular commented 6 years ago

cn_cbor_encoder_write returns -1 on error. In several cases any non-zero result was treated as success. In two cases, a -1 result would be converted to size_t and returned when a 0 result should be returned.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.01%) to 68.747% when pulling 1ce08c74469ce6423ded9cf96f30bb2ecd940a02 on sbertin-telular:encoder_write_result into e8427268ab18ff53fb383f9c8abcb75bcab31ca9 on cose-wg:master.