Opened 3 years ago

Closed 3 years ago

#33368 closed Bug (fixed)

Durationfield.clean fails to handle broken data

Reported by: Florian Apolloner Owned by: Pedro Schlickmann Mendes
Component: Core (Other) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description (last modified by Florian Apolloner)

The actual input string was 'P3(3D'

 === Uncaught Python exception: ===
	ValueError: could not convert string to float: '3(3'
	Traceback (most recent call last):
	  File "basic_fuzzer.py", line 22, in TestOneInput
	  File "fuzzers.py", line 294, in test_forms_DurationField
	  File "django/forms/fields.py", line 149, in clean
	  File "django/forms/fields.py", line 502, in to_python
	  File "django/utils/dateparse.py", line 154, in parse_duration
	  File "django/utils/dateparse.py", line 154, in <dictcomp>
	

Change History (7)

comment:1 by Florian Apolloner, 3 years ago

Description: modified (diff)

comment:2 by Florian Apolloner, 3 years ago

Description: modified (diff)

comment:3 by Pedro Schlickmann Mendes, 3 years ago

Owner: changed from nobody to Pedro Schlickmann Mendes
Status: newassigned

comment:4 by Pedro Schlickmann Mendes, 3 years ago

Has patch: set
Version 0, edited 3 years ago by Pedro Schlickmann Mendes (next)

comment:5 by Mariusz Felisiak, 3 years ago

Patch needs improvement: set

comment:6 by Mariusz Felisiak, 3 years ago

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:7 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

Resolution: fixed
Status: assignedclosed

In 4fd3044c:

Fixed #33368 -- Fixed parse_duration() crash on invalid separators for decimal fractions.

Note: See TracTickets for help on using tickets.
Back to Top