From e8b3d0decfa58776fab3492ae6406e58ad60a05c Mon Sep 17 00:00:00 2001 From: tadf Date: Fri, 12 Aug 2011 23:48:18 +0000 Subject: [PATCH] * ext/date/date_core.c: [ruby-core:38855]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ ext/date/date_core.c | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index 52d38dbd15..1bcfad895e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sat Aug 13 08:47:20 2011 Tadayoshi Funaba + + * ext/date/date_core.c: [ruby-core:38855]. + Sat Aug 13 03:41:37 2011 Eric Hodel * lib/uri/common.rb: Fix documentation of URI::Parser.new. Patch by diff --git a/ext/date/date_core.c b/ext/date/date_core.c index 08328b9e8f..6474074028 100644 --- a/ext/date/date_core.c +++ b/ext/date/date_core.c @@ -4089,6 +4089,9 @@ d_new_by_frags(VALUE klass, VALUE hash, VALUE sg) rb_warning("invalid start is ignored"); } + if (NIL_P(hash)) + rb_raise(rb_eArgError, "invalid date"); + if (NIL_P(ref_hash("jd")) && NIL_P(ref_hash("yday")) && !NIL_P(ref_hash("year")) && @@ -7853,6 +7856,9 @@ dt_new_by_frags(VALUE klass, VALUE hash, VALUE sg) rb_warning("invalid start is ignored"); } + if (NIL_P(hash)) + rb_raise(rb_eArgError, "invalid date"); + if (NIL_P(ref_hash("jd")) && NIL_P(ref_hash("yday")) && !NIL_P(ref_hash("year")) &&