lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Dec 30, 2011, at 1:09 PM, Josh Simmons wrote:

Why not just limit n at the parser level? Far simpler than any alternative. It's not like your application really needs to handle arbitrary numbers of fields all at once.

You have to be careful with HTTP header fields too.

That does raise an interesting alternative solution. The string interning logic could optionally detect when a chain of strings had exceeded some limit and then fail the effort to add the string. This is probably only recommended in controlled contexts where one is prepared for the error to occur, but by blocking the problem at the point where we're interning the strings we avoid needing to protect the hash table cases.