mozilla/socorro-crashstats — pull request #208 by AdrianGaudebert (2012-10-23 15:49:21+00:00)
Title: Fixes bug 801773 - Prevent null bytes from breaking form validation.

@peterbe @rhelmer What do you think about this? Is it acceptable?

The problem here is the following: a unicode string containing a null byte is being passed to the ``date`` parameter, that value is then passed to the ``QueryForm`` which tries to parse it to make it a ``datetime`` object. Problem: ``datetime.datetime.strftime`` raises a ``TypeError`` when a null byte is passed in the first argument, and that error is not being caught by django, thus making the entire app fail.

I added a unit test reproducing the problem. You can also test with a browser: http://localhost:8000/query/?date=%00

I'm happy to discuss this problem, and how to best solve it.