[
https://issues.apache.org/jira/browse/HDFS-16007?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17340080#comment-17340080
]
Viraj Jasani commented on HDFS-16007:
-------------------------------------
For any new ReplicaState introduced in future, if we just append value after
last one (TEMPORARY(4) as of today), it should work fine right?
{quote}add index checking in the read and getState function to avoid index out
of bound error.
{quote}
Are you suggesting this so that we can throw simple error message, something
like "Provided index should be in the range of: 0 to cachedValues.length-1"? If
so, then it makes sense.
> Vulnerabilities found when serializing enum value
> -------------------------------------------------
>
> Key: HDFS-16007
> URL: https://issues.apache.org/jira/browse/HDFS-16007
> Project: Hadoop HDFS
> Issue Type: Improvement
> Reporter: junwen yang
> Priority: Major
>
> ReplicaState enum is using ordinal to conduct serialization and
> deserialization, which is vulnerable to the order, to cause issues similar to
> HDFS-15624.
> To avoid it, either adding comments to let later developer not to change this
> enum, or add index checking in the read and getState function to avoid index
> out of bound error.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]