Граф коммитов

5320 Коммитов

Автор SHA1 Сообщение Дата
hsbt e221c6cefc * ext/psych/lib/psych.rb: Merge psych-2.0.5. bump version to
libyaml-0.1.6 for CVE-2014-2525.
* ext/psych/yaml/config.h: ditto.
* ext/psych/yaml/scanner.c: ditto.
* ext/psych/yaml/yaml_private.h: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-28 00:19:15 +00:00
nobu 1dd527012b thread.c: undumpable
* ext/thread/thread.c (undumpable): ConditionVariable and Queue
  are not dumpable.  [ruby-core:61677] [Bug #9674]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-26 02:20:26 +00:00
kazu 6df5f314ac remove unnecessary unshift
* ext/pathname/lib/pathname.rb (Pathname#join): remove unnecessary unshift.
* test/pathname/test_pathname.rb (TestPathname#test_join): add tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-25 14:42:36 +00:00
nobu 3981d60ba2 dl/extconf.rb: check for -fno-defer-pop option
* ext/dl/extconf.rb: check for -fno-defer-pop option, since clang
  5.1 no longer support -fno-defer-pop option.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-20 03:21:52 +00:00
nobu d90075cb10 json/parser/prereq.mk: use enum
* ext/json/parser/prereq.mk (parser.c): use `enum` instead of
  `static const int` to get rid of unused-const-variable warnings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-17 04:57:19 +00:00
nobu 6224216294 unused functions and variables
* complex.c, rational.c: remove unused functions, which are warned
  by clang 5.1, and also variables only used by removed functions.

* ext/date/date_core.c: ditto.

* enc/utf_16be.c, enc/utf_16le.c: comment out constants only used
  by commented out functions.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-17 04:57:14 +00:00
ktsj 1cde307767 * ext/.document: remove refinement from documentable directories.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-15 09:56:43 +00:00
usa 1df0e183dd * ext/-test-/win32/dln/libdlntest.c (dlntest_ordinal): no need to
specify export in the source file because .def file do it.
  get rid of warning on linking.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-13 14:52:19 +00:00
ktsj c1f1b93171 * ext/.document: add objspace/objspace_dump.c to document file.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-11 13:33:31 +00:00
charliesome c8c539a198 ext/objspace: Check fptr before trying to dump FILE object fd
Patch by Scott Francis. Closes GH-562.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-10 21:55:51 +00:00
nobu dfdb8b7372 fiddle/function.c: fix memory leak on exception
* ext/fiddle/function.c (function_call): fix memory leak when an
  exception occurs at argument conversion or the function call.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-09 04:51:38 +00:00
nobu 1692e54793 fiddle/function.c: check argument size
* ext/fiddle/function.c (initialize): check argument number if the
  temporary buffer exceeds size_t max.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-09 04:51:17 +00:00
nobu ff84a6a2e7 ext/dl, ext/fiddle: fix memory leak
* ext/dl/cptr.c (dlptr_free), ext/dl/handle.c (dlhandle_free),
  ext/fiddle/handle.c (fiddle_handle_free),
  ext/fiddle/pointer.c (fiddle_ptr_free): fix memory leak.
  based on the patch Heesob Park at [ruby-dev:48021] [Bug #9599].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-08 04:46:57 +00:00
emboss 699b209cf8 * lib/openssl/ssl.rb: Explicitly whitelist the default
SSL/TLS ciphers. Forbid SSLv2 and SSLv3, disable
  compression by default.
  Reported by Jeff Hodges.
  [ruby-core:59829] [Bug #9424]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-06 01:43:53 +00:00
nobu 89e70fe8e7 ossl.c: NULL check
* ext/openssl/ossl.c (ossl_make_error): check NULL for unknown
  error reasons with old OpenSSL, and insert a colon iff formatted
  message is not empty.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-05 02:58:59 +00:00
ktsj df0991f34b * ext/pathname/lib/pathname.rb (Pathname#find): add "ignore_error"
keyword argument defaulted to true as well as Find#find.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-04 15:44:53 +00:00
normal fd61a78303 use do/while(0) around GetDBM macros
* README.EXT: wrap GetDBM with do/while(0)
* README.EXT.ja: ditto
* ext/dbm/dbm.c: ditto, likewise for GetDBM2
* ext/gdbm/gdbm.c: ditto
* ext/sdbm/init.c: ditto
  [ruby-core:61217]

ref: http://c-faq.com/cpp/multistmt.html

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-02 22:50:31 +00:00
akr 083bf23759 A comment added.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-02 06:22:27 +00:00
nobu 2bb8811484 extconf.rb: rl_hook_func_t for old readline
* ext/readline/extconf.rb (rl_hook_func_t): define as Function for
  very old readline versions.  [ruby-core:61209] [Bug #9578]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-02 02:13:41 +00:00
akr ed6a2d3bf6 * ext/readline/readline.c (Init_readline): Use rl_hook_func_t instead
of Function to support readline-6.3.  (rl_hook_func_t is available
  since readline-4.2.)
  Reported by Dmitry Medvinsky.  [ruby-core:61141] [Bug #9578]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-01 07:19:08 +00:00
tenderlove db17d694ea * ext/psych/lib/psych/visitors/yaml_tree.rb: support dumping Encoding
objects.

* ext/psych/lib/psych/visitors/to_ruby.rb: support loading Encoding
  objects.

* test/psych/test_encoding.rb: add test

* ext/psych/lib/psych.rb: add version

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-01 02:09:53 +00:00
kazu 4f180097d3 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
2014-02-25 14:18:13 +00:00
nobu 82eeaadc5d option.c: use rb_w32_inet_pton
* ext/socket/option.c (inet_pton): use rb_w32_inet_pton, instead of
  inet_ntop directly, which is unavailable on older version Windows.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-23 03:18:56 +00:00
nobu 95be5381ec raddrinfo.c: suppress warnings
* ext/socket/raddrinfo.c (numeric_getaddrinfo): move conditionally
  used variables inside the block, to suppress warnings on platforms
  where inet_pton() is not available.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-23 01:29:25 +00:00
usa 64904f51d7 * ext/io/console/console.c (console_dev): need read access for conout$
because some functions need it.  [Bug#9554]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-22 10:11:25 +00:00
akr a6da4b274d Fix a filename.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-22 04:02:43 +00:00
kazu fedc3a4b5f fix second argument of MEMZERO
* ext/socket/raddrinfo.c (rb_getaddrinfo): second argument of
  MEMZERO is type.  Coverity Scan found this bug.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-21 16:04:50 +00:00
shugo 139d06c34f * ext/socket/init.c (wait_connectable): break if the socket is
writable to avoid infinite loops on FreeBSD and other platforms
  which conforms to SUSv3.  This problem cannot be reproduced with
  loopback interfaces, so it's hard to write test code.
  rsock_connect() and wait_connectable() are overly complicated, so
  they should be refactored, but I commit this fix as a workaround
  for the release of Ruby 1.9.3 scheduled on Feb 24.
  [ruby-core:60940] [Bug #9547]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-21 14:59:44 +00:00
nobu 1f29e8e2ba class.c: do nothing if copying self
* class.c (rb_mod_init_copy): do nothing if copying self.
  [ruby-dev:47989] [Bug #9535]
* hash.c (rb_hash_initialize_copy): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-21 11:42:03 +00:00
normal d691a28d91 socket: sendmsg/recvmsg only retries blocking on errors
* ext/socket/ancdata.c (bsock_sendmsg_internal): only retry on error
  (bsock_recvmsg_internal): ditto
* test/socket/test_unix.rb: test above for infinite loop

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-21 00:55:13 +00:00
akr 81dfa8b397 * ext/socket/raddrinfo.c (numeric_getaddrinfo): Use xcalloc.
Suggested by Eric Wong.
  https://bugs.ruby-lang.org/issues/9525#note-14



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-20 13:22:44 +00:00
akr 2e6b97a45d * ext/socket: Bypass getaddrinfo() if node and serv are numeric.
Reporeted by Naotoshi Seo.  [ruby-core:60801] [Bug #9525]

* ext/socket/extconf.rb: Detect struct sockaddr_in6.sin6_len.

* ext/socket/sockport.h (SET_SIN6_LEN): New macro.
  (INIT_SOCKADDR_IN6): Ditto.

* ext/socket/rubysocket.h (struct rb_addrinfo): Add
  allocated_by_malloc field.

* ext/socket/raddrinfo.c (numeric_getaddrinfo): New function.
  (rb_getaddrinfo): Call numeric_getaddrinfo at first.
  (rb_freeaddrinfo): Free struct addrinfo properly when it is
  allocated by numeric_getaddrinfo.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-19 10:37:43 +00:00
akr dd1c3a7509 * ext/socket: Wrap struct addrinfo by struct rb_addrinfo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-19 09:38:24 +00:00
akr 948ce9decb * ext/socket/ipsocket.c (ip_s_getaddress): Don't access freed memory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-19 08:51:33 +00:00
mrkn 260cdec9a9 * ext/bigdecimal/bigdecimal.c (BigDecimal_initialize): Insert GC guard.
* ext/bigdecimal/bigdecimal.c (BigDecimal_global_new): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-16 17:14:11 +00:00
nobu 6ef6dab36d ext/psych/yaml: suppress warnings
* ext/psych/yaml/emitter.c (WRITE_BREAK, PUT_BREAK): suppress
  unused-value warnings.

* ext/psych/yaml/parser.c, ext/psych/yaml/scanner.c: suppress
  unused-but-set-variable warnings.

* ext/psych/yaml/yaml_private.h (STACK_EMPTY): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-16 07:53:20 +00:00
nobu beb2d4c5a5 bigdecimal.c: refine macros
* ext/bigdecimal/bigdecimal.c (PUSH, SAVE): remove extra
  semicolons.

* ext/bigdecimal/bigdecimal.c (GUARD_OBJ): add parentheses and
  make an expression instead of a statement.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-16 07:53:18 +00:00
akr 037ceae571 * ext/bigdecimal/bigdecimal.c (BIGNUM_ZERO_P): Unused macro removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-15 22:48:43 +00:00
akr 3c99764bcd * internal.h: Rename macro names: RBIGNUM_FOO to BIGNUM_FOO.
(BIGNUM_EMBED_LEN_NUMBITS): Renamed from RBIGNUM_EMBED_LEN_NUMBITS.
  (BIGNUM_EMBED_LEN_MAX): Renamed from RBIGNUM_EMBED_LEN_MAX.
  (BIGNUM_SIGN_BIT): Renamed from RBIGNUM_SIGN_BIT.
  (BIGNUM_SIGN): Renamed from RBIGNUM_SIGN.
  (BIGNUM_SET_SIGN): Renamed from RBIGNUM_SET_SIGN.
  (BIGNUM_POSITIVE_P): Renamed from RBIGNUM_POSITIVE_P.
  (BIGNUM_NEGATIVE_P): Renamed from RBIGNUM_NEGATIVE_P.
  (BIGNUM_EMBED_FLAG): Renamed from RBIGNUM_EMBED_FLAG.
  (BIGNUM_EMBED_LEN_MASK): Renamed from RBIGNUM_EMBED_LEN_MASK.
  (BIGNUM_EMBED_LEN_SHIFT): Renamed from RBIGNUM_EMBED_LEN_SHIFT.
  (BIGNUM_LEN): Renamed from RBIGNUM_LEN.
  (RBIGNUM_DIGITS): Renamed from RBIGNUM_DIGITS.
  (BIGNUM_LENINT): Renamed from RBIGNUM_LENINT.

* bignum.c: Follow the above change.

* gc.c: Ditto.

* marshal.c: Ditto.

* math.c: Ditto.

* numeric.c: Ditto.

* random.c: Ditto.

* rational.c: Ditto.

* sprintf.c: Ditto.

* ext/-test-/bignum/bigzero.c: Ditto.

* ext/-test-/bignum/intpack.c: Ditto.

* ext/bigdecimal/bigdecimal.c: Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-15 21:17:34 +00:00
shirosaki abb6b5073e fd_setsize/depend: fix wrong dependencies
* ext/-test-/win32/fd_setsize/depend: fix wrong dependencies.
  [ruby-dev:47253]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-15 01:59:40 +00:00
akr ab9bc151e8 * include/ruby/ruby.h,
internal.h,
  ext/-test-/bignum/bigzero.c: Hide a Bignum definition.
  [ruby-core:42891] [Feature #6083]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-14 15:29:10 +00:00
akr 6f8b0e9bb0 * include/ruby/intern.h,
include/ruby/io.h,
  include/ruby/ruby.h,
  include/ruby/win32.h,
  include/ruby/backward/rubysig.h,
  bignum.c,
  gc.c,
  io.c,
  process.c,
  safe.c,
  struct.c,
  thread.c,
  ext/socket/rubysocket.h,
  ext/-test-/old_thread_select: Remove deprecated definitions
  [ruby-core:60581] [Feature #9502]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-14 15:16:31 +00:00
nobu 897a42b063 yaml/api.c: fix typo
* ext/psych/yaml/api.c (yaml_emitter_delete): fix typo 'empty'
  with 'emitter'.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-12 09:01:28 +00:00
nobu 4cac2f4ada bigdecimal.h: suppress warnings
* ext/bigdecimal/bigdecimal.h (VpSetZero, VpSetInf): get rid of
  unused-value warnings by gcc 4.9.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-12 02:25:28 +00:00
akr 09e6766d1a * ext/bigdecimal/bigdecimal.c (BigMath_s_log): Use rb_big_cmp instead of
RBIGNUM_NEGATIVE_P.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-11 14:55:37 +00:00
akr c1de2f4e3a * bignum.c (rb_big_cmp): Specialize a comparison to zero.
* ext/bigdecimal/bigdecimal.c (is_negative): Use rb_big_cmp instead of
  RBIGNUM_NEGATIVE_P.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-11 14:43:23 +00:00
akr ab67419b75 * ext/openssl/ossl_bn.c (ossl_bn_initialize): Use rb_integer_pack.
Fix SEGV by OpenSSL::BN.new(1 << (2**34)).



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-11 14:06:51 +00:00
zzak bdeedccc5f * ext/tk/README.tcltklib: [DOC] Fix typo by @xta [Fixes GH-532] [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-11 08:02:01 +00:00
zzak 9699d0ddf4 * ext/ripper/lib/ripper/lexer.rb: [DOC] use lower case version of core
classes when referring to return value, since we aren't directly
  talking about the class. Patch by Jonathan Jackson [Bug #9483]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-07 12:57:44 +00:00
hsbt c6c6a74fed * ext/stringio/stringio.c: [DOC] add docs and example by @schneems [ci skip] [fix GH-527]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-06 03:08:38 +00:00