[jboss-jira] [JBoss JIRA] (ELY-618) Dead code in DEREncoder

Farah Juma (JIRA) issues at jboss.org
Fri Jun 8 16:34:00 EDT 2018


    [ https://issues.jboss.org/browse/ELY-618?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13588897#comment-13588897 ] 

Farah Juma commented on ELY-618:
--------------------------------

Great, thanks [~ivassile].

> Dead code in DEREncoder
> -----------------------
>
>                 Key: ELY-618
>                 URL: https://issues.jboss.org/browse/ELY-618
>             Project: WildFly Elytron
>          Issue Type: Bug
>    Affects Versions: 1.1.0.Beta7
>            Reporter: Ondrej Lukas
>            Assignee: Ilia Vassilev
>              Labels: static_analysis
>
> There is an unintentional dead code in writeTag method of org.wildfly.security.asn1.DEREncoder. Variable {{tagNumber}} can be assigned to 31 as its maximal value from {{int tagNumber = tag & TAG_NUMBER_MASK;}} (because {{TAG_NUMBER_MASK = 0x1f}}) on line 576 [1] which means that condition {{if (tagNumber < 128)}} on line 582 is always true. It causes that else branch is never executed.
> [1] https://github.com/wildfly-security/wildfly-elytron/blob/4453ea40a7a617b62f039153f7ebfb903c619406/src/main/java/org/wildfly/security/asn1/DEREncoder.java#L576



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the jboss-jira mailing list