@@ -471,11 +471,8 @@ _FORCE_INLINE_ void CodeSignRequirements::_parse_key(uint32_t &r_pos, String &r_
471471 ERR_FAIL_COND_MSG (r_pos >= p_rq_size, " CodeSign/Requirements: Out of bounds." );
472472 const uint32_t key_size = _R (r_pos);
473473 ERR_FAIL_COND_MSG (r_pos + key_size > p_rq_size, " CodeSign/Requirements: Out of bounds." );
474- CharString key;
475- key.resize (key_size);
476- memcpy (key.ptrw (), blob.ptr () + r_pos + 4 , key_size);
477474 r_pos += 4 + key_size + PAD (key_size, 4 );
478- r_out += " [" + String::utf8 (key ) + " ]" ;
475+ r_out += " [" + String::utf8 (( const char *)blob. ptr () + r_pos + 4 , key_size ) + " ]" ;
479476#undef _R
480477}
481478
@@ -515,10 +512,7 @@ _FORCE_INLINE_ void CodeSignRequirements::_parse_hash_string(uint32_t &r_pos, St
515512 ERR_FAIL_COND_MSG (r_pos >= p_rq_size, " CodeSign/Requirements: Out of bounds." );
516513 uint32_t tag_size = _R (r_pos);
517514 ERR_FAIL_COND_MSG (r_pos + tag_size > p_rq_size, " CodeSign/Requirements: Out of bounds." );
518- PackedByteArray data;
519- data.resize (tag_size);
520- memcpy (data.ptrw (), blob.ptr () + r_pos + 4 , tag_size);
521- r_out += " H\" " + String::hex_encode_buffer (data.ptr (), data.size ()) + " \" " ;
515+ r_out += " H\" " + String::hex_encode_buffer (blob.ptr () + r_pos + 4 , tag_size) + " \" " ;
522516 r_pos += 4 + tag_size + PAD (tag_size, 4 );
523517#undef _R
524518}
@@ -528,11 +522,8 @@ _FORCE_INLINE_ void CodeSignRequirements::_parse_value(uint32_t &r_pos, String &
528522 ERR_FAIL_COND_MSG (r_pos >= p_rq_size, " CodeSign/Requirements: Out of bounds." );
529523 const uint32_t key_size = _R (r_pos);
530524 ERR_FAIL_COND_MSG (r_pos + key_size > p_rq_size, " CodeSign/Requirements: Out of bounds." );
531- CharString key;
532- key.resize (key_size);
533- memcpy (key.ptrw (), blob.ptr () + r_pos + 4 , key_size);
534525 r_pos += 4 + key_size + PAD (key_size, 4 );
535- r_out += " \" " + String::utf8 (key ) + " \" " ;
526+ r_out += " \" " + String::utf8 (( const char *)blob. ptr () + r_pos + 4 , key_size ) + " \" " ;
536527#undef _R
537528}
538529
0 commit comments