We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8adc3cf commit d393c16Copy full SHA for d393c16
src/cborparser.c
@@ -203,10 +203,13 @@ static CborError preparse_value(CborValue *it)
203
it->extra = 0;
204
205
/* read up to 16 bits into it->extra */
206
- if (bytesNeeded <= 2) {
+ if (bytesNeeded == 1) {
207
+ uint8_t extra;
208
+ read_bytes_unchecked(it, &extra, 1, bytesNeeded);
209
+ it->extra = extra;
210
+ } else if (bytesNeeded == 2) {
211
read_bytes_unchecked(it, &it->extra, 1, bytesNeeded);
- if (bytesNeeded == 2)
- it->extra = cbor_ntohs(it->extra);
212
+ it->extra = cbor_ntohs(it->extra);
213
} else {
214
cbor_static_assert(CborIteratorFlag_IntegerValueTooLarge == (Value32Bit & 3));
215
cbor_static_assert((CborIteratorFlag_IntegerValueIs64Bit |
0 commit comments