зеркало из https://github.com/github/ruby.git
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
This commit is contained in:
Родитель
df9199d468
Коммит
4f180097d3
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,16 @@
|
||||||
|
Tue Feb 25 22:52:02 2014 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
|
||||||
|
|
||||||
|
* ext/dl/dl.c (rb_dl_realloc): use NUM2SIZET instead of NUM2INT.
|
||||||
|
|
||||||
|
* ext/fiddle/fiddle.c (rb_fiddle_realloc): ditto.
|
||||||
|
|
||||||
|
Tue Feb 25 22:49:30 2014 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
Tue Feb 25 12:06:13 2014 NARUSE, Yui <naruse@ruby-lang.org>
|
Tue Feb 25 12:06:13 2014 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
* win32/Makefile.sub: define PACKED_STRUCT.
|
* win32/Makefile.sub: define PACKED_STRUCT.
|
||||||
|
|
|
@ -81,7 +81,7 @@ rb_dl_malloc(VALUE self, VALUE size)
|
||||||
{
|
{
|
||||||
void *ptr;
|
void *ptr;
|
||||||
|
|
||||||
ptr = (void*)ruby_xmalloc(NUM2INT(size));
|
ptr = (void*)ruby_xmalloc(NUM2SIZET(size));
|
||||||
return PTR2NUM(ptr);
|
return PTR2NUM(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ rb_dl_realloc(VALUE self, VALUE addr, VALUE size)
|
||||||
{
|
{
|
||||||
void *ptr = NUM2PTR(addr);
|
void *ptr = NUM2PTR(addr);
|
||||||
|
|
||||||
ptr = (void*)ruby_xrealloc(ptr, NUM2INT(size));
|
ptr = (void*)ruby_xrealloc(ptr, NUM2SIZET(size));
|
||||||
return PTR2NUM(ptr);
|
return PTR2NUM(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ rb_fiddle_malloc(VALUE self, VALUE size)
|
||||||
{
|
{
|
||||||
void *ptr;
|
void *ptr;
|
||||||
|
|
||||||
ptr = (void*)ruby_xmalloc(NUM2INT(size));
|
ptr = (void*)ruby_xmalloc(NUM2SIZET(size));
|
||||||
return PTR2NUM(ptr);
|
return PTR2NUM(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ rb_fiddle_realloc(VALUE self, VALUE addr, VALUE size)
|
||||||
{
|
{
|
||||||
void *ptr = NUM2PTR(addr);
|
void *ptr = NUM2PTR(addr);
|
||||||
|
|
||||||
ptr = (void*)ruby_xrealloc(ptr, NUM2INT(size));
|
ptr = (void*)ruby_xrealloc(ptr, NUM2SIZET(size));
|
||||||
return PTR2NUM(ptr);
|
return PTR2NUM(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче