File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -207,10 +207,10 @@ bool UpdateClass::setCryptKey(const uint8_t *cryptKey){
207
207
}
208
208
// initialize
209
209
if (!_cryptKey){
210
- _cryptKey = ( uint8_t *) malloc ( ENCRYPTED_KEY_SIZE) ;
210
+ _cryptKey = new (std::nothrow) uint8_t [ ENCRYPTED_KEY_SIZE] ;
211
211
}
212
212
if (!_cryptKey){
213
- log_e (" malloc failed" );
213
+ log_e (" new failed" );
214
214
return false ;
215
215
}
216
216
memcpy (_cryptKey, cryptKey, ENCRYPTED_KEY_SIZE);
@@ -303,10 +303,10 @@ bool UpdateClass::_decryptBuffer(){
303
303
return false ;
304
304
}
305
305
if (!_cryptBuffer){
306
- _cryptBuffer = ( uint8_t *) malloc ( ENCRYPTED_BLOCK_SIZE) ;
306
+ _cryptBuffer = new (std::nothrow) uint8_t [ ENCRYPTED_BLOCK_SIZE] ;
307
307
}
308
308
if (!_cryptBuffer){
309
- log_e (" malloc failed" );
309
+ log_e (" new failed" );
310
310
return false ;
311
311
}
312
312
uint8_t tweaked_key[ENCRYPTED_KEY_SIZE]; // tweaked crypt key
You can’t perform that action at this time.
0 commit comments