I've had a crash in this line by using RNCryptor library
https://github.com/jasenhuang/NSObjectSafe/blob/703982ea9f0797b0cbfd168c24d4d077fdacb2cc/NSObjectSafe/NSObjectSafe.m#L868
Setting <= self.length fixed the crash but I don't know whether something else will be broken or not
@kiritoxcii would you show the demo code or paste crash stack?
I have the same problem,the crash stack:2019-03-01 17:11:51.292927+0800 AndClient Chinamobile[8572:2364047] /Users/ningliu/AndClient-iOS/AndClient/Extensions/Safe/NSObjectSafe.m|-[NSMutableData(Safe) hookReplaceBytesInRange:withBytes:]|1005|hookReplaceBytesInRange:withBytes: range.location error
2019-03-01 17:11:51.292992+0800 AndClient Chinamobile[8572:2364047] *** Assertion failure in -[NSConcreteMutableData replaceBytesInRange:withBytes:], /Users/ningliu/AndClient-iOS/AndClient/Extensions/Safe/NSObjectSafe.m:1005
2019-03-01 17:11:51.294340+0800 AndClient Chinamobile[8572:2364047] dynamic_cast error 2: One or more of the following type_info's has hidden visibility. They should all have public visibility. N10__cxxabiv116__shim_type_infoE, id, N10__cxxabiv117__pbase_type_infoE.
2019-03-01 17:11:51.294367+0800 AndClient Chinamobile[8572:2364047] dynamic_cast error 2: One or more of the following type_info's has hidden visibility. They should all have public visibility. N10__cxxabiv116__shim_type_infoE, id, N10__cxxabiv117__pbase_type_infoE.
2019-03-01 17:11:51.333728+0800 AndClient Chinamobile[8572:2364047] [Bugly] Trapped uncaught exception 'NSInternalInconsistencyException', reason: 'hookReplaceBytesInRange:withBytes: range.location error'
[
"0 CoreFoundation 0x000000021b1a0edc
@leo4developer @kiritoxcii actually, it's Assertion failure inside NSObjectSafe because of replaceBytesInRange with range.location == data.length,the default behavior of system api will append bytes to target.change to <= self.length is right.
@leo4developer @kiritoxcii actually, it's Assertion failure inside NSObjectSafe because of replaceBytesInRange with range.location == data.length,the default behavior of system api will append bytes to target.change to <= self.length is right.
谢谢!