[jira] Created: (NET-185) Possible NPE in Threader.java

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (NET-185) Possible NPE in Threader.java

JIRA jira@apache.org
Possible NPE in Threader.java
-----------------------------

                 Key: NET-185
                 URL: https://issues.apache.org/jira/browse/NET-185
             Project: Commons Net
          Issue Type: Bug
         Environment: Fortify
            Reporter: Henri Yandell
             Fix For: 1.5


In Threader.gatherSubjects, it appears to be possible for tail.next = c.child; to be null [line 356]:

        349 if (old.threadable == null && c.threadable == null) {
        350 // both dummies - merge them
        351 ThreadContainer tail;
        352 for (tail = old.child;
        353 tail != null && tail.next != null;
        354 tail = tail.next);
        355
        356 tail.next = c.child;

It also seems kind of pointless, given that the subsequent line immediately resets tail to c.child. Perhaps the ; is not intended there?

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Closed: (NET-185) Possible NPE in Threader.java

JIRA jira@apache.org

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

Rory Winston closed NET-185.
----------------------------

    Resolution: Later

> Possible NPE in Threader.java
> -----------------------------
>
>                 Key: NET-185
>                 URL: https://issues.apache.org/jira/browse/NET-185
>             Project: Commons Net
>          Issue Type: Bug
>         Environment: Fortify
>            Reporter: Henri Yandell
>             Fix For: 1.5
>
>
> In Threader.gatherSubjects, it appears to be possible for tail.next = c.child; to be null [line 356]:
> 349 if (old.threadable == null && c.threadable == null) {
> 350 // both dummies - merge them
> 351 ThreadContainer tail;
> 352 for (tail = old.child;
> 353 tail != null && tail.next != null;
> 354 tail = tail.next);
> 355
> 356 tail.next = c.child;
> It also seems kind of pointless, given that the subsequent line immediately resets tail to c.child. Perhaps the ; is not intended there?

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (NET-185) Possible NPE in Threader.java

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/NET-185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12571080#action_12571080 ]

Henri Yandell commented on NET-185:
-----------------------------------

Why closed as "Later" and not left open without a fix version?

Once something is closed I'm not convinced people will notice the issues again.

> Possible NPE in Threader.java
> -----------------------------
>
>                 Key: NET-185
>                 URL: https://issues.apache.org/jira/browse/NET-185
>             Project: Commons Net
>          Issue Type: Bug
>         Environment: Fortify
>            Reporter: Henri Yandell
>             Fix For: 1.5
>
>
> In Threader.gatherSubjects, it appears to be possible for tail.next = c.child; to be null [line 356]:
> 349 if (old.threadable == null && c.threadable == null) {
> 350 // both dummies - merge them
> 351 ThreadContainer tail;
> 352 for (tail = old.child;
> 353 tail != null && tail.next != null;
> 354 tail = tail.next);
> 355
> 356 tail.next = c.child;
> It also seems kind of pointless, given that the subsequent line immediately resets tail to c.child. Perhaps the ; is not intended there?

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Reopened: (NET-185) Possible NPE in Threader.java

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Rory Winston reopened NET-185:
------------------------------


> Possible NPE in Threader.java
> -----------------------------
>
>                 Key: NET-185
>                 URL: https://issues.apache.org/jira/browse/NET-185
>             Project: Commons Net
>          Issue Type: Bug
>         Environment: Fortify
>            Reporter: Henri Yandell
>             Fix For: 2.1
>
>
> In Threader.gatherSubjects, it appears to be possible for tail.next = c.child; to be null [line 356]:
> 349 if (old.threadable == null && c.threadable == null) {
> 350 // both dummies - merge them
> 351 ThreadContainer tail;
> 352 for (tail = old.child;
> 353 tail != null && tail.next != null;
> 354 tail = tail.next);
> 355
> 356 tail.next = c.child;
> It also seems kind of pointless, given that the subsequent line immediately resets tail to c.child. Perhaps the ; is not intended there?

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (NET-185) Possible NPE in Threader.java

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/NET-185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12571150#action_12571150 ]

Rory Winston commented on NET-185:
----------------------------------

Henri

You're right. I'll mark this against the next version so it doesn't get forgotten. Thanks!

> Possible NPE in Threader.java
> -----------------------------
>
>                 Key: NET-185
>                 URL: https://issues.apache.org/jira/browse/NET-185
>             Project: Commons Net
>          Issue Type: Bug
>         Environment: Fortify
>            Reporter: Henri Yandell
>             Fix For: 2.1
>
>
> In Threader.gatherSubjects, it appears to be possible for tail.next = c.child; to be null [line 356]:
> 349 if (old.threadable == null && c.threadable == null) {
> 350 // both dummies - merge them
> 351 ThreadContainer tail;
> 352 for (tail = old.child;
> 353 tail != null && tail.next != null;
> 354 tail = tail.next);
> 355
> 356 tail.next = c.child;
> It also seems kind of pointless, given that the subsequent line immediately resets tail to c.child. Perhaps the ; is not intended there?

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (NET-185) Possible NPE in Threader.java

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Rory Winston resolved NET-185.
------------------------------

       Resolution: Later
    Fix Version/s:     (was: 1.5)
                   2.1

> Possible NPE in Threader.java
> -----------------------------
>
>                 Key: NET-185
>                 URL: https://issues.apache.org/jira/browse/NET-185
>             Project: Commons Net
>          Issue Type: Bug
>         Environment: Fortify
>            Reporter: Henri Yandell
>             Fix For: 2.1
>
>
> In Threader.gatherSubjects, it appears to be possible for tail.next = c.child; to be null [line 356]:
> 349 if (old.threadable == null && c.threadable == null) {
> 350 // both dummies - merge them
> 351 ThreadContainer tail;
> 352 for (tail = old.child;
> 353 tail != null && tail.next != null;
> 354 tail = tail.next);
> 355
> 356 tail.next = c.child;
> It also seems kind of pointless, given that the subsequent line immediately resets tail to c.child. Perhaps the ; is not intended there?

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (NET-185) Possible NPE in Threader.java

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/NET-185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12571288#action_12571288 ]

Henri Yandell commented on NET-185:
-----------------------------------

Still confused :) Why resolved and not just left open?

> Possible NPE in Threader.java
> -----------------------------
>
>                 Key: NET-185
>                 URL: https://issues.apache.org/jira/browse/NET-185
>             Project: Commons Net
>          Issue Type: Bug
>         Environment: Fortify
>            Reporter: Henri Yandell
>             Fix For: 2.1
>
>
> In Threader.gatherSubjects, it appears to be possible for tail.next = c.child; to be null [line 356]:
> 349 if (old.threadable == null && c.threadable == null) {
> 350 // both dummies - merge them
> 351 ThreadContainer tail;
> 352 for (tail = old.child;
> 353 tail != null && tail.next != null;
> 354 tail = tail.next);
> 355
> 356 tail.next = c.child;
> It also seems kind of pointless, given that the subsequent line immediately resets tail to c.child. Perhaps the ; is not intended there?

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Reopened: (NET-185) Possible NPE in Threader.java

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Sebb reopened NET-185:
----------------------


Not yet resolved, so re-opening

> Possible NPE in Threader.java
> -----------------------------
>
>                 Key: NET-185
>                 URL: https://issues.apache.org/jira/browse/NET-185
>             Project: Commons Net
>          Issue Type: Bug
>         Environment: Fortify
>            Reporter: Henri Yandell
>             Fix For: 2.1
>
>
> In Threader.gatherSubjects, it appears to be possible for tail.next = c.child; to be null [line 356]:
> 349 if (old.threadable == null && c.threadable == null) {
> 350 // both dummies - merge them
> 351 ThreadContainer tail;
> 352 for (tail = old.child;
> 353 tail != null && tail.next != null;
> 354 tail = tail.next);
> 355
> 356 tail.next = c.child;
> It also seems kind of pointless, given that the subsequent line immediately resets tail to c.child. Perhaps the ; is not intended there?

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (NET-185) Possible NPE in Threader.java

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Sebb updated NET-185:
---------------------

    Fix Version/s:     (was: 2.1)

> Possible NPE in Threader.java
> -----------------------------
>
>                 Key: NET-185
>                 URL: https://issues.apache.org/jira/browse/NET-185
>             Project: Commons Net
>          Issue Type: Bug
>         Environment: Fortify
>            Reporter: Henri Yandell
>
> In Threader.gatherSubjects, it appears to be possible for tail.next = c.child; to be null [line 356]:
> 349 if (old.threadable == null && c.threadable == null) {
> 350 // both dummies - merge them
> 351 ThreadContainer tail;
> 352 for (tail = old.child;
> 353 tail != null && tail.next != null;
> 354 tail = tail.next);
> 355
> 356 tail.next = c.child;
> It also seems kind of pointless, given that the subsequent line immediately resets tail to c.child. Perhaps the ; is not intended there?

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (NET-185) Possible NPE in Threader.java

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Rory Winston updated NET-185:
-----------------------------

    Priority: Minor  (was: Major)

> Possible NPE in Threader.java
> -----------------------------
>
>                 Key: NET-185
>                 URL: https://issues.apache.org/jira/browse/NET-185
>             Project: Commons Net
>          Issue Type: Bug
>         Environment: Fortify
>            Reporter: Henri Yandell
>            Priority: Minor
>
> In Threader.gatherSubjects, it appears to be possible for tail.next = c.child; to be null [line 356]:
> 349 if (old.threadable == null && c.threadable == null) {
> 350 // both dummies - merge them
> 351 ThreadContainer tail;
> 352 for (tail = old.child;
> 353 tail != null && tail.next != null;
> 354 tail = tail.next);
> 355
> 356 tail.next = c.child;
> It also seems kind of pointless, given that the subsequent line immediately resets tail to c.child. Perhaps the ; is not intended there?

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Closed: (NET-185) Possible NPE in Threader.java

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Rory Winston closed NET-185.
----------------------------

       Resolution: Invalid
    Fix Version/s: 2.1

* c shouldnt be null (its in the iteration condition)
* tail is _not_ set: it is tail.next. The loop is a simple linked-list iterator.

> Possible NPE in Threader.java
> -----------------------------
>
>                 Key: NET-185
>                 URL: https://issues.apache.org/jira/browse/NET-185
>             Project: Commons Net
>          Issue Type: Bug
>         Environment: Fortify
>            Reporter: Henri Yandell
>            Priority: Minor
>             Fix For: 2.1
>
>
> In Threader.gatherSubjects, it appears to be possible for tail.next = c.child; to be null [line 356]:
> 349 if (old.threadable == null && c.threadable == null) {
> 350 // both dummies - merge them
> 351 ThreadContainer tail;
> 352 for (tail = old.child;
> 353 tail != null && tail.next != null;
> 354 tail = tail.next);
> 355
> 356 tail.next = c.child;
> It also seems kind of pointless, given that the subsequent line immediately resets tail to c.child. Perhaps the ; is not intended there?

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Reopened: (NET-185) Possible NPE in Threader.java

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Sebb reopened NET-185:
----------------------


The for loop can exit with tail == null if old.child == null.

> Possible NPE in Threader.java
> -----------------------------
>
>                 Key: NET-185
>                 URL: https://issues.apache.org/jira/browse/NET-185
>             Project: Commons Net
>          Issue Type: Bug
>         Environment: Fortify
>            Reporter: Henri Yandell
>            Priority: Minor
>             Fix For: 2.1
>
>
> In Threader.gatherSubjects, it appears to be possible for tail.next = c.child; to be null [line 356]:
> 349 if (old.threadable == null && c.threadable == null) {
> 350 // both dummies - merge them
> 351 ThreadContainer tail;
> 352 for (tail = old.child;
> 353 tail != null && tail.next != null;
> 354 tail = tail.next);
> 355
> 356 tail.next = c.child;
> It also seems kind of pointless, given that the subsequent line immediately resets tail to c.child. Perhaps the ; is not intended there?

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (NET-185) Possible NPE in Threader.java

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Rory Winston updated NET-185:
-----------------------------

    Fix Version/s:     (was: 2.1)

> Possible NPE in Threader.java
> -----------------------------
>
>                 Key: NET-185
>                 URL: https://issues.apache.org/jira/browse/NET-185
>             Project: Commons Net
>          Issue Type: Bug
>         Environment: Fortify
>            Reporter: Henri Yandell
>            Priority: Minor
>
> In Threader.gatherSubjects, it appears to be possible for tail.next = c.child; to be null [line 356]:
> 349 if (old.threadable == null && c.threadable == null) {
> 350 // both dummies - merge them
> 351 ThreadContainer tail;
> 352 for (tail = old.child;
> 353 tail != null && tail.next != null;
> 354 tail = tail.next);
> 355
> 356 tail.next = c.child;
> It also seems kind of pointless, given that the subsequent line immediately resets tail to c.child. Perhaps the ; is not intended there?

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (NET-185) Possible NPE in Threader.java

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Sebb updated NET-185:
---------------------

    Component/s: NNTP

> Possible NPE in Threader.java
> -----------------------------
>
>                 Key: NET-185
>                 URL: https://issues.apache.org/jira/browse/NET-185
>             Project: Commons Net
>          Issue Type: Bug
>          Components: NNTP
>         Environment: Fortify
>            Reporter: Henri Yandell
>            Priority: Minor
>
> In Threader.gatherSubjects, it appears to be possible for tail.next = c.child; to be null [line 356]:
> 349 if (old.threadable == null && c.threadable == null) {
> 350 // both dummies - merge them
> 351 ThreadContainer tail;
> 352 for (tail = old.child;
> 353 tail != null && tail.next != null;
> 354 tail = tail.next);
> 355
> 356 tail.next = c.child;
> It also seems kind of pointless, given that the subsequent line immediately resets tail to c.child. Perhaps the ; is not intended there?

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.