bugGNUstep Application Project - Bugs: bug #61756, [Grr.app] raises an exception if...

 
 

bug #61756: [Grr.app] raises an exception if an ampersand isn't used as the start of an entity

Submitter:  Sergei Golovin <svg>
Submitted:  Mon 03 Jan 2022 09:49:28 AM UTC
 
Category:  Application Severity:  3 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
       No canned response available

 

( Jump to the original submission )

Wed 26 Jan 2022 04:48:43 AM UTC, comment #8: 

It works.

Sergei Golovin <svg>
Tue 25 Jan 2022 09:06:12 PM UTC, comment #7: 

comment #5:

>
> The already defined 'outOfTagStopSet' is '&<', different than my 'entityEnd' => ';<'. Your patch fixes the issue but breaks HTML entity recognition.


Sorry! my fault, I wanted to make it more robust but missed ; obviously.
Fixed and commited.. please try if I have overseen something else.

I noticed that certain attributes are not properly parsed or for several attributes are not located; I'll open a separate bug to collaborate on that.

Riccardo Mottola <rmottola>
Project Administrator
Tue 25 Jan 2022 03:06:18 AM UTC, comment #6: 

comment #4:

> I think here there is another invalid HTML, but did not manage to find it today.


Grr doesn't tolerate empty HTML attributes. I will open another bugreport with a patch supplied.

Sergei Golovin <svg>
Tue 25 Jan 2022 03:04:16 AM UTC, comment #5: 

comment #3:

> Thank you a lot. I reworked your patch not to use exceptions and use the already defined terminator character set.
> Please try it, so that I will commit it.


The already defined 'outOfTagStopSet' is '&<', different than my 'entityEnd' => ';<'. Your patch fixes the issue but breaks HTML entity recognition.

Sergei Golovin <svg>
Tue 25 Jan 2022 12:37:46 AM UTC, comment #4: 

I just discovered that in the redhat stream there is another article causing issues:

2022-01-25 01:14:25.465 Grr[32603:32603] ERROR: HTML PARSING:
 name: NSInvalidArgumentException
 desc: <NSException: 0x563f19405c00> NAME:NSInvalidArgumentException REASON:[NSURL initWithString:relativeToURL:] bad string parameter INFO:(null)
[GFX1-]: Couldn't sanitize RENDERER device: A

https://developers.redhat.com/articles/2022/01/17/reduce-size-container-images-dockerslim

I think here there is another invalid HTML, but did not manage to find it today.

Riccardo Mottola <rmottola>
Project Administrator
Tue 25 Jan 2022 12:21:55 AM UTC, comment #3: 

Thank you a lot. I reworked your patch not to use exceptions and use the already defined terminator character set.
Please try it, so that I will commit it.

(file #52721)

Riccardo Mottola <rmottola>
Project Administrator
Mon 24 Jan 2022 05:52:49 AM UTC, comment #2: 

I have created a test feed with a copy of the malformed article

https://svgol.github.io/rss

Sergei Golovin <svg>
Sun 23 Jan 2022 10:22:07 PM UTC, comment #1: 

Interesting issue - technically the code is wrong, but handling of it could be better.
I wanted to test on this and check your implementation, which at a first glance seems reasonable, however I cannot see the article in the feed anymore. Can it e that only 2022 articles are listed?
I wonder how else I can test this: another feed? some settings?
Or create a bogus entry in a blog, I don't think I can on my own with blogspot, since it would be a fault in the editor o let an unescaped character through.

Riccardo Mottola <rmottola>
Project Administrator
Mon 03 Jan 2022 09:49:28 AM UTC, original submission:  

I am subscribed to https://developers.redhat.com/blog/feed which brought me the article https://developers.redhat.com/articles/2021/12/17/how-connect-prometheus-openshift-streams-apache-kafka.

The article contains the chunk <strong>Save & Test</strong> which raises an exception in Grr because the Components/ArticleView/NSString+TolerantHTML.m treats any '&' as the start of an entity.

The changes in the supplied patch catch the exception and proceed the bad '&' as a plaintext.

Sergei Golovin <svg>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #52721:  escape-patch.diff added by rmottola (2KiB - text/x-diff)
file #52602:  grr.patch added by svg (2KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rmottola (Posted a comment)
  • -email is unavailable- added by svg (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

     

     

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-01-26 rmottola Open/ClosedOpen Closed
    2022-01-26 rmottola StatusReady For Test Fixed
    2022-01-25 rmottola StatusNone Ready For Test
    2022-01-25 rmottola Attached File- Added escape-patch.diff, #52721
    2022-01-03 svg Attached File- Added grr.patch, #52602

    Back to the top


    Powered by Savane 3.9