Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7013876

RemoveCommentReader fails to correctly recognize comments in PAC file

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 6
    • Fix Version/s: 6
    • Component/s: deploy
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_xp

      Description

      FULL PRODUCT VERSION :
      java version "1.6.0_22"
      Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
      Java HotSpot(TM) Client VM (build 17.1-b03, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      When Java WebStart begins, it attempts to discover the web proxy information from the default browser settings. In our case it downloads the auto proxy javascript file from http://xxxxxxxx/wpad.dat . In order to correctly use the code encapsulated in the auto proxy file it needs to parse it through Internet Explorer’s javascript engine.
      Prior to doing this, WebStart will attempt to strip out all the comments in the auto proxy file along with replacing newline characters (\n) with spaces using com.sun.deploy.net.proxy.RemoveCommentReader.
       
      When RemoveCommentReader.read is executed and the buffer is not completely filled with data but the last character in the read data is the opening / of a comment block the code fails to recognise that fact and will not properly strip the comments out.
       
      This leaves the javascript on a single line but with an inline comment. Since code exists after the left in comments, the javascript engine fails to correctly parse the code and we an the error.
       
      The issue is seen intermittently due to the variability in the network when downloading the auto proxy file. The bug is only exposed if the file is read in chunks that happen to end mid-way through the opening // or /* of a comment block.



      REPRODUCIBILITY :
      This bug can be reproduced occasionally.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: