Valentin, I meant the behaviour of this code when corrupted data from the network are being deserialized. Assertion is no-op in production, and we silently ignore binary format violation.
27 июля 2017 г. 21:09 пользователь "Valentin Kulichenko" < [email protected]> написал: > Andrey, > > How will it corrupt the data? Assertions only reads the array, not updates > it, right? > > -Val > > On Thu, Jul 27, 2017 at 8:54 AM, Andrey Kuznetsov <[email protected]> > wrote: > > > Hi Igniters, > > > > While examining BinaryObjectImpl code I found this curious line in > typeId() > > method: > > > > assert arr[off] == GridBinaryMarshaller.STRING : arr[off]; > > > > Is it OK to check external binary data with assertions? > > I think it can lead to undefined behaviour on corrupt data from the wire. > > > > -- > > Best regards, > > Andrey Kuznetsov. > > >
