Uploaded image for project: 'Apache Any23 (Retired)'
  1. Apache Any23 (Retired)
  2. ANY23-387

Possible OutOfMemoryError with bad deeply nested HTML

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.2
    • 2.3
    • microdata
    • None

    Description

      Could be related to https://issues.apache.org/jira/browse/ANY23-386 as the OutOfMemoryError is not present using the version 2.1.

       

       

       

      With the following snippet of HTML as input:

       

       

      <html>
      <head>
          <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      </head>
      <body>
      <div  itemscope itemtype='http://schema.org/Product'>
      
      <span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review">
              <span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review">
                  <span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review">
                      <span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review">
                          <span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review">
                              <span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review">
                                  <span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review">
                                      <span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review">
                                          <span itemprop="review" itemscope="itemscope" itemtype="http://schema.org/Review">
                                              <span itemprop="review" itemscope="itemscope"
                                                    itemtype="http://schema.org/Review">
                                                  <span itemprop="review" itemscope="itemscope"
                                                        itemtype="http://schema.org/Review">
                                                      <span itemprop="review" itemscope="itemscope"
                                                            itemtype="http://schema.org/Review">
                                                          <span itemprop="review" itemscope="itemscope"
                                                                itemtype="http://schema.org/Review">
                                                              <span itemprop="review" itemscope="itemscope"
                                                                    itemtype="http://schema.org/Review">
                                                                  <span itemprop="review" itemscope="itemscope"
                                                                        itemtype="http://schema.org/Review">
                                                                      <span itemprop="review" itemscope="itemscope"
                                                                            itemtype="http://schema.org/Review">
                                                                          <span itemprop="review" itemscope="itemscope"
                                                                                itemtype="http://schema.org/Review">
                                                                              <span itemprop="review" itemscope="itemscope"
                                                                                    itemtype="http://schema.org/Review">
                                                                                  <span itemprop="review"
                                                                                        itemscope="itemscope"
                                                                                        itemtype="http://schema.org/Review"><span
                                                                                          itemprop="review"
                                                                                          itemscope="itemscope"
                                                                                          itemtype="http://schema.org/Review"><span
                                                                                          itemprop="review"
                                                                                          itemscope="itemscope"
                                                                                          itemtype="http://schema.org/Review"><span
                                                                                          itemprop="review"
                                                                                          itemscope="itemscope"
                                                                                          itemtype="http://schema.org/Review"><span
                                                                                          itemprop="review"
                                                                                          itemscope="itemscope"
                                                                                          itemtype="http://schema.org/Review"><span
                                                                                          itemprop="review"
                                                                                          itemscope="itemscope"
                                                                                          itemtype="http://schema.org/Review"><span
                                                                                          itemprop="review"
                                                                                          itemscope="itemscope"
                                                                                          itemtype="http://schema.org/Review"><span
                                                                                          itemprop="review"
                                                                                          itemscope="itemscope"
                                                                                          itemtype="http://schema.org/Review"><div
                                                                                          itemprop="review"
                                                                                          itemscope="itemscope"
                                                                                          itemtype="http://schema.org/Review"/></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>
      </div>
      </body>
      </html>
      
      

       

      Calling `toJson` on the retrieved ItemScope will crash the JVM with an `OutOfMemoryError`

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            panthony Anthony Pessy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: