Fix potential integer overflows identified by Coverity
Convert ODK_LAST_STRESSABLE_TYPE to an aliased enum value so that ODK_FieldLength always returns a valid value instead of SIZE_MAX. PiperOrigin-RevId: 602823670 Change-Id: I7a843cacca8201677c0f31249112c04f6c3e04cb
This commit is contained in:
@@ -28,7 +28,7 @@ enum ODK_FieldType {
|
||||
ODK_HASH,
|
||||
// The "stressable" types are the ones we can put in a stress test that packs
|
||||
// and unpacks random data and can expect to get back the same thing.
|
||||
ODK_LAST_STRESSABLE_TYPE,
|
||||
ODK_LAST_STRESSABLE_TYPE = ODK_HASH,
|
||||
// Put boolean after ODK_LAST_STRESSABLE_TYPE, so that we skip boolean type in
|
||||
// SerializeFieldsStress because we unpack any nonzero to 'true'.
|
||||
ODK_BOOL,
|
||||
|
||||
Reference in New Issue
Block a user