Skip to content

Commit 739ad81

Browse files
nobumatzbot
authored andcommitted
[ruby/date] Check month range as civil
1 parent cb80ee7 commit 739ad81

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ext/date/date_core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,8 @@ c_valid_civil_p(int y, int m, int d, double sg,
761761

762762
if (m < 0)
763763
m += 13;
764+
if (m < 1 || m > 12)
765+
return 0;
764766
if (d < 0) {
765767
if (!c_find_ldom(y, m, sg, rjd, ns))
766768
return 0;

0 commit comments

Comments
 (0)