… | |
… | |
749 | if (ecb_expect_true ((U8)(*dec->cur - MAJOR_BYTES) <= LENGTH_EXT8)) |
749 | if (ecb_expect_true ((U8)(*dec->cur - MAJOR_BYTES) <= LENGTH_EXT8)) |
750 | { |
750 | { |
751 | I32 len = decode_uint (dec); |
751 | I32 len = decode_uint (dec); |
752 | char *key = (char *)dec->cur; |
752 | char *key = (char *)dec->cur; |
753 | |
753 | |
|
|
754 | WANT (len); |
754 | dec->cur += len; |
755 | dec->cur += len; |
755 | |
756 | |
756 | hv_store (hv, key, len, decode_sv (dec), 0); |
757 | hv_store (hv, key, len, decode_sv (dec), 0); |
757 | |
758 | |
758 | return; |
759 | return; |
759 | } |
760 | } |
760 | else if (ecb_expect_true ((U8)(*dec->cur - MAJOR_TEXT) <= LENGTH_EXT8)) |
761 | else if (ecb_expect_true ((U8)(*dec->cur - MAJOR_TEXT) <= LENGTH_EXT8)) |
761 | { |
762 | { |
762 | I32 len = decode_uint (dec); |
763 | I32 len = decode_uint (dec); |
763 | char *key = (char *)dec->cur; |
764 | char *key = (char *)dec->cur; |
764 | |
765 | |
|
|
766 | WANT (len); |
765 | dec->cur += len; |
767 | dec->cur += len; |
766 | |
768 | |
767 | if (ecb_expect_false (dec->cbor.flags & F_VALIDATE_UTF8)) |
769 | if (ecb_expect_false (dec->cbor.flags & F_VALIDATE_UTF8)) |
768 | if (!is_utf8_string (key, len)) |
770 | if (!is_utf8_string (key, len)) |
769 | ERR ("corrupted CBOR data (invalid UTF-8 in map key)"); |
771 | ERR ("corrupted CBOR data (invalid UTF-8 in map key)"); |