<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>10120</bug_id>
          
          <creation_ts>2010-07-09 10:33:41 +0000</creation_ts>
          <short_desc>Checker may crash when CSS @charset declaration is invalid</short_desc>
          <delta_ts>2010-07-09 16:29:14 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>mobileOK Basic checker</product>
          <component>Java Library</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="fd">fd</reporter>
          <assigned_to name="fd">fd</assigned_to>
          
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>36720</commentid>
    <comment_count>0</comment_count>
    <who name="fd">fd</who>
    <bug_when>2010-07-09 10:33:41 +0000</bug_when>
    <thetext>The following invalid @charset declaration makes the library crash:
 @charset=&quot;utf-8&quot;;
(it is invalid because of the &quot;=&quot; sign which should not be there)

The exception is as follows:

Exception in thread &quot;main&quot; org.w3c.mwi.mobileok.basic.TestException: One or more exceptions were caught while processing the resources:
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
java.lang.String.substring(String.java:1949)
org.w3c.mwi.mobileok.basic.CSSUtils.extractCSSWarnings(CSSUtils.java:277)
org.w3c.mwi.mobileok.basic.CssContent.&lt;init&gt;(CssContent.java:119)
org.w3c.mwi.mobileok.basic.MobileOKDecodedContentFactory.decodeContent(MobileOKDecodedContentFactory.java:93)
org.w3c.mwi.mobileok.basic.Resource.decode(Resource.java:239)
org.w3c.mwi.mobileok.basic.Preprocessor.processResource(Preprocessor.java:475)
org.w3c.mwi.mobileok.basic.Preprocessor.access$0(Preprocessor.java:450)
org.w3c.mwi.mobileok.basic.Preprocessor$2.run(Preprocessor.java:513)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
java.lang.Thread.run(Thread.java:636)

at org.w3c.mwi.mobileok.basic.Preprocessor.preprocess(Preprocessor.java:420)
at org.w3c.mwi.mobileok.basic.Tester.getPreprocessorResults(Tester.java:140)
at org.w3c.mwi.mobileok.basic.Tester.main(Tester.java:397)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36735</commentid>
    <comment_count>1</comment_count>
    <who name="fd">fd</who>
    <bug_when>2010-07-09 16:29:14 +0000</bug_when>
    <thetext>The code was taking for granted that the line that contains the invalid at-rule would contain a space, leading to the out of range exception.

Code sanitized.

Created a bug on the CSS validator because the messages returned by the CSS validator are a bit misleading in that case:
http://www.w3.org/Bugs/Public/show_bug.cgi?id=10124 (bug 10124)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>