Edgewall Software

Ticket #151 (new defect)

Opened 4 years ago

Last modified 21 months ago

Undefined behavor of extended iteration

Reported by: aronacher Owned by: cmlenz
Priority: major Milestone: 0.6.1
Component: General Version: 0.4.4
Keywords: Cc:

Description (last modified by cmlenz) (diff)

Right now for foo.bar, blub['blah'] in something is undefined in genshi (it does nothing, especially no error) and for foo['a in b'] in bar breaks with a syntax error although it's valid python.

Because of my work on the sandboxed branch it's important that iterations do not modify existing objects because they could be persistent, thus shared among renderings. A quickfix would be changing the in split to a regex like this:

r([A-Za-z_][A-Za-z0-9_]*(\s*,\s*[A-Za-z_][A-Za-z0-9_]*)*)\s+in

That would then automatically close the security problem of the sandbox branch too.

Attachments

Change History

Changed 4 years ago by cmlenz

  • description modified (diff)

(fixed formatting of description)

Changed 4 years ago by Armin Ronacher

Here a regexp that supports nested tuples. Hackish because it also matches some invalid constructs but a user gets a parsing error later anyways:

r'([(A-Za-z_][A-Za-z0-9_)]*(\s*,\s*[(A-Za-z_][A-Za-z0-9_)]*)*)\s+in'

Changed 4 years ago by cmlenz

  • priority changed from blocker to major
  • milestone changed from 0.5 to 0.5.1

Postponing.

Changed 4 years ago by cmlenz

  • milestone changed from 0.5.1 to 0.5.2

Changed 3 years ago by anonymous

sddsdsdddsddds

Changed 3 years ago by cmlenz

  • milestone changed from 0.5.2 to 0.6

Changed 2 years ago by cmlenz

  • milestone changed from 0.6 to 0.6.1

Changed 21 months ago by Carsten Klein <carsten.klein@…>

I would like to help fixing this issue, but I don't understand what the OP actually means.

Could you please provide a testcase or code fragment that exactly reproduces your issue in the context of say a template and an input document?

Add/Change #151 (Undefined behavor of extended iteration)

Author


E-mail address and user name can be saved in the Preferences.


Change Properties
<Author field>
Action
as new
as The resolution will be set. Next status will be 'closed'
to The owner will change from cmlenz. Next status will be 'new'
The owner will change from cmlenz to anonymous. Next status will be 'assigned'
 
Note: See TracTickets for help on using tickets.