summaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-01-07 05:27:01 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-01-07 05:27:01 +0000
commit643286909b266e602eb213e1f278d8923ecbd445 (patch)
treef078d8b669b793ff8665e26d445cb50dabec75e0 /string.c
parent0334509cdaa6da69d67d188143382b60ba166e10 (diff)
downloadruby-643286909b266e602eb213e1f278d8923ecbd445.tar.gz
ruby-643286909b266e602eb213e1f278d8923ecbd445.tar.xz
ruby-643286909b266e602eb213e1f278d8923ecbd445.zip
* string.c (rb_str_new2): NULL pointer check added.
* class.c (rb_define_module_under): should locate predefined module using rb_const_defined_at(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/string.c b/string.c
index 49b44fa85..77794d984 100644
--- a/string.c
+++ b/string.c
@@ -80,6 +80,9 @@ VALUE
rb_str_new2(ptr)
const char *ptr;
{
+ if (!ptr) {
+ rb_raise(rb_eArgError, "NULL pointer given");
+ }
return rb_str_new(ptr, strlen(ptr));
}