fix: do not read length of 'bytes' field into size_t, use uint32_t instead