You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by bu...@apache.org on 2008/03/29 01:54:27 UTC

DO NOT REPLY [Bug 44704] New: Potential null pointer dereference in Main

https://issues.apache.org/bugzilla/show_bug.cgi?id=44704

           Summary: Potential null pointer dereference in Main
           Product: Batik
           Version: 1.7
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: SVG Viewer
        AssignedTo: batik-dev@xmlgraphics.apache.org
        ReportedBy: david_dillard@symantec.com


Starting at line 299 in org.apache.batik.apps.svgbrowser.Main() is the
following code:

                            JSVGViewerFrame relativeTo =
                                viewerFrames.isEmpty()
                                    ?  null
                                    : (JSVGViewerFrame) viewerFrames.get(0);
                            AboutDialog dlg = new AboutDialog(relativeTo);
                            // Work around pack() bug on some platforms
                            dlg.setSize(dlg.getPreferredSize());
                            dlg.setLocationRelativeTo(relativeTo);

relativeTo may be set to null.  This will later get passed do
setLocationRelativeTo().  In AboutDlg's overridden version of this method the
parameter is unconditionally dereferenced, which could cause a null pointer
exception.

AboutDlg.setLocationRelativeTo() should probably be changed to accept a null
value to maintain the contract set by AboutDlg's parent JWindow.


This was detected by FindBugs.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org


DO NOT REPLY [Bug 44704] Potential null pointer dereference in Main

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44704


Cameron McCormack <ca...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




--- Comment #1 from Cameron McCormack <ca...@apache.org>  2008-05-31 04:45:53 PST ---
Since there will always be at least one window open, relativeTo should never
actually be null.  I've removed the check for viewerFrames.isEmpty() now in
r662008.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org