flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ted Yu (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (FLINK-4309) Potential null pointer dereference in DelegatingConfiguration#keySet()
Date Tue, 09 Aug 2016 18:15:22 GMT

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

Ted Yu updated FLINK-4309:
--------------------------
    Description: 
{code}
    final int prefixLen = this.prefix == null ? 0 : this.prefix.length();

    for (String key : this.backingConfig.keySet()) {
      if (key.startsWith(this.prefix)) {
{code}

If this.prefix == null, we would get NPE in startsWith():
{code}
    public boolean startsWith(String prefix, int toffset) {
        char ta[] = value;
        int to = toffset;
        char pa[] = prefix.value;
{code}

  was:
{code}
    final int prefixLen = this.prefix == null ? 0 : this.prefix.length();

    for (String key : this.backingConfig.keySet()) {
      if (key.startsWith(this.prefix)) {
{code}
If this.prefix == null, we would get NPE in startsWith():
{code}
    public boolean startsWith(String prefix, int toffset) {
        char ta[] = value;
        int to = toffset;
        char pa[] = prefix.value;
{code}


> Potential null pointer dereference in DelegatingConfiguration#keySet()
> ----------------------------------------------------------------------
>
>                 Key: FLINK-4309
>                 URL: https://issues.apache.org/jira/browse/FLINK-4309
>             Project: Flink
>          Issue Type: Bug
>            Reporter: Ted Yu
>            Priority: Minor
>
> {code}
>     final int prefixLen = this.prefix == null ? 0 : this.prefix.length();
>     for (String key : this.backingConfig.keySet()) {
>       if (key.startsWith(this.prefix)) {
> {code}
> If this.prefix == null, we would get NPE in startsWith():
> {code}
>     public boolean startsWith(String prefix, int toffset) {
>         char ta[] = value;
>         int to = toffset;
>         char pa[] = prefix.value;
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message