You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by "Florian Müller (JIRA)" <ji...@apache.org> on 2017/03/31 14:47:41 UTC

[jira] [Updated] (CMIS-1014) Incorrect validation: sub-expression is always false

     [ https://issues.apache.org/jira/browse/CMIS-1014?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Florian Müller updated CMIS-1014:
---------------------------------
    Fix Version/s: OpenCMIS 1.1.0

> Incorrect validation: sub-expression is always false
> ----------------------------------------------------
>
>                 Key: CMIS-1014
>                 URL: https://issues.apache.org/jira/browse/CMIS-1014
>             Project: Chemistry
>          Issue Type: Bug
>          Components: opencmis-server
>    Affects Versions: OpenCMIS 1.0.0
>            Reporter: AppChecker
>            Assignee: Jens Hübel
>             Fix For: OpenCMIS 1.1.0
>
>
> Hi!
> There is [condition|https://github.com/apache/chemistry-opencmis/blob/48ec4de7547025fdca1d10c6bee439751373ecbd/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/NameValidator.java#L75]:
> {code:xml}
>            if (c == '\\' || c == '/' || c == '\"' || c == ':' || c == '*' || c == '?' || c == '<' || c == '>'
>                     && c == '|') {
>                 return false;
>             }
> {code}
> This expression is equivalent to:
> (c == '\\' || c == '/' || c == '\"' || c == ':' || c == '*' || c == '?' || c == '<' ||  ( c == '>'
>                     && c == '|' )  )
> but
> (c == '>' && c == '|') is always false.
> So, condition is equivalent to
> (c == '\\' || c == '/' || c == '\"' || c == ':' || c == '*' || c == '?' || c == '<'  || false)
> or
> (c == '\\' || c == '/' || c == '\"' || c == ':' || c == '*' || c == '?' || c == '<' )
> Probably need to replace the '&' to '||'
> This possible defect found by [AppChecker|https://cnpo.ru/en/solutions/appchecker.php]



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)