summaryrefslogtreecommitdiff
path: root/ext/fiddle
diff options
context:
space:
mode:
authorkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-25 14:18:13 +0000
committerkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-25 14:18:13 +0000
commit4f180097d31c3532455366a23fe5830b32f5eb0a (patch)
tree3e0ca10373141c43a143ee206c5d879c1ba1d737 /ext/fiddle
parentdf9199d468ffd0b0dfc669dbbb8923301a4b1d07 (diff)
use NUM2SIZET instead of NUM2INT
* ext/dl/dl.c (rb_dl_realloc): use NUM2SIZET instead of NUM2INT. * ext/fiddle/fiddle.c (rb_fiddle_realloc): ditto. * ext/dl/dl.c (rb_dl_malloc): use NUM2SIZET instead of NUM2INT. Coverity Scan found this bug. * ext/fiddle/fiddle.c (rb_fiddle_malloc): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/fiddle')
-rw-r--r--ext/fiddle/fiddle.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/fiddle/fiddle.c b/ext/fiddle/fiddle.c
index 7a7c708..9f3d153 100644
--- a/ext/fiddle/fiddle.c
+++ b/ext/fiddle/fiddle.c
@@ -48,7 +48,7 @@ rb_fiddle_malloc(VALUE self, VALUE size)
{
void *ptr;
- ptr = (void*)ruby_xmalloc(NUM2INT(size));
+ ptr = (void*)ruby_xmalloc(NUM2SIZET(size));
return PTR2NUM(ptr);
}
@@ -64,7 +64,7 @@ rb_fiddle_realloc(VALUE self, VALUE addr, VALUE size)
{
void *ptr = NUM2PTR(addr);
- ptr = (void*)ruby_xrealloc(ptr, NUM2INT(size));
+ ptr = (void*)ruby_xrealloc(ptr, NUM2SIZET(size));
return PTR2NUM(ptr);
}