shyouhei
e9fae3a2a9
merge revision(s) 20354:
...
* string.c (str_independent): no independent string points null_str.
[ruby-core:20082]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@22366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-17 02:59:26 +00:00
shyouhei
98657d4e68
merge revision(s) 20287:
...
* string.c (rb_str_s_alloc, rb_str_replace): use null_str as well as
rb_string_value so that extension libraries do not segfault.
[ruby-core:19971]
* string.c (rb_str_replace): reduced unnecessary malloc and copy.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@22353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-16 14:08:52 +00:00
shyouhei
b3f0632590
merge revision(s) 17719:
...
* string.c (rb_str_format_m): make tmp volatile to avoid possible GC
problem.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@18114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-17 12:33:59 +00:00
shyouhei
cea5e4cbda
merge revision(s) 17530:
...
* string.c (str_buf_cat): check for self concatenation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@17735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-30 11:36:43 +00:00
shyouhei
b5eb973b1a
merge revision(s) 17483:
...
* string.c (rb_str_buf_append): should infect.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@17488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-20 09:28:35 +00:00
shyouhei
855e79f3de
merge revision(s) 17470:17472:
...
* array.c (rb_ary_store, rb_ary_splice): not depend on unspecified
behavior at integer overflow.
* string.c (str_buf_cat): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@17480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-20 07:38:15 +00:00
shyouhei
594a34beda
* array.c (ary_new, rb_ary_initialize, rb_ary_store,
...
rb_ary_aplice, rb_ary_times): integer overflows should be
checked. based on patches from Drew Yao <ayao at apple.com>
fixed CVE-2008-2726
* string.c (rb_str_buf_append): fixed unsafe use of alloca,
which led memory corruption. based on a patch from Drew Yao
<ayao at apple.com> fixed CVE-2008-2726
* sprintf.c (rb_str_format): backported from trunk.
* intern.h: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@17460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-19 23:12:46 +00:00
knu
2b785b0f3e
Merge changes from ruby_1_8 to reduce warnings and potentially improve
...
security.
* mkconfig.rb: hide build path from rbconfig.rb.
* util.c (ruby_strtod, dtoa): initialize more variables for error
handling.
* io.c (rscheck), marshal.c (w_nbyte, w_bytes, w_unique),
(path2class, path2module): constified.
* pack.c (pack_unpack), process.c (rb_syswait): suppress warnings.
* suppress warnings on cygwin, mingw and mswin.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-06 10:39:57 +00:00
knu
f072d4e34a
Merge from ruby_1_8.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-31 11:44:49 +00:00
knu
3d84188855
Merge from ruby_1_8.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-28 08:55:41 +00:00
knu
acdda413ab
Merge from ruby_1_8.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-28 08:52:57 +00:00
knu
8480bcc8d5
Merge -r16241:16456 from ruby_1_8.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-18 15:02:36 +00:00
knu
e926ef5233
* random.c (rb_genrand_int32, rb_genrand_real), intern.h: Export.
...
* string.c (rb_str_tmp_new), intern.h: New function.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-14 10:52:17 +00:00
knu
f5f1a18ceb
* enum.c (enum_find, enum_reject): Return an enumerator if no
...
block is given.
* io.c (rb_io_each_line, rb_io_each_byte, rb_io_s_foreach,
argf_each_line, argf_each_byte): Ditto.
* string.c (str_gsub): Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-14 09:19:52 +00:00
knu
60dde833c3
* string.c (rb_str_each_char): New methods: String#chars and
...
#each_char.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16001 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-14 05:01:30 +00:00
knu
9fb81662b5
* string.c (rb_str_each_line, rb_str_each_byte): Reflect
...
enumerator integration. #lines and #bytes are now aliases to
#each_line and #each_byte, respectively.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-14 04:44:01 +00:00
knu
7d848354f8
* string.c (rb_str_partition, rb_str_rpartition,
...
rb_str_start_with, rb_str_end_with): New methods:
String#partition, #rpartition, #start_with? and #end_with?;
backported from 1.9. These methods are $KCODE aware unlike
#index, #rindex and #include?.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-14 04:16:23 +00:00
nobu
5982102848
* string.c (rb_str_lines, rb_str_bytes): ditto.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@14728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-27 02:02:47 +00:00
nobu
9e1da70e14
* intern.h, string.c (rb_str_set_len): added for upgrading path from
...
1.8 to 1.9. [ruby-dev:32807]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@14727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-27 02:01:24 +00:00
matz
015014380b
* string.c (rb_str_to_i): update RDoc since base can be any value
...
between 2 and 36. [ruby-talk:272879]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-06 14:17:55 +00:00
shyouhei
a32a1b7a03
Sorry nobu, reverting r13473, which turned out to be a SEGV-generator.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-23 08:20:11 +00:00
nobu
b21b9a46cf
* string.c (str_alloc): defaults to null_str instead of NULL.
...
[ruby-dev:31774]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-20 16:46:21 +00:00
matz
bf0c93851a
* string.c (rb_str_splice): integer overflow for length.
...
[ruby-dev:31739]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-05 13:18:23 +00:00
nobu
8af410bdb5
* string.c (rb_str_rindex_m): accept string-like object convertible
...
with #to_str method, as well as rb_str_index_m. [ruby-core:11692]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-16 09:29:35 +00:00
usa
915e23730e
* string.c (rb_str_sub_bang): calling rb_str_modify() should be just
...
before actually modifying the string.
fixed: [ruby-dev:30211] (originally reported by zunda)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-01-30 06:04:37 +00:00
matz
7ba0cd826e
* string.c (rb_str_upto): String#upto from empty string makes
...
inifinite loop. [ruby-core:09864]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-01-08 19:02:50 +00:00
matz
46fa18da5b
Revert r11453
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-01-03 03:14:57 +00:00
matz
4ee717dcae
* io.c (ruby_dup): start GC on ENOMEM as well.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-01-03 02:51:44 +00:00
matz
27f520056e
* string.c (rb_str_aset): index double decode problem.
...
[ruby-core:09695]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-12-11 00:45:32 +00:00
nobu
ba431dde6f
* string.c (rb_str_substr): should be infected with only original
...
string, but not the shared string. fixed: [ruby-core:09152]
* strnig.c (rb_str_new4): keep shared string untainted when orignal
string is tainted. fixed: [ruby-dev:29672]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-22 07:48:53 +00:00
matz
9436f5b0cb
* string.c (rb_str_scan): small documentation fix.
...
[ruby-core:09007]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-07 15:55:17 +00:00
matz
b6f0af7888
* string.c (rb_str_intern): raise SecurityError only when $SAFE
...
level is greater than zero. [ruby-core:08862]
* parse.y (rb_interned_p): new function to check if a string is
already interned.
* object.c (str_to_id): use rb_str_intern().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-14 07:25:56 +00:00
matz
a0cc731f58
* string.c (rb_str_intern): prohibit interning tainted string.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-13 07:49:54 +00:00
matz
17c3d539f0
* ruby.h: use ifdef (or defined) for macro constants that may or
...
may not be defined to shut up gcc's -Wundef warnings.
[ruby-core:08447]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-31 06:34:10 +00:00
matz
63b2b93950
* string.c (rb_str_scan): add string modification check.
...
[ruby-core:7216]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-26 07:43:16 +00:00
usa
f940a107ee
* string.c (rb_str_dump): need to extend len for \b.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-11 08:34:28 +00:00
matz
004a9f77c5
* string.c (rb_str_inspect): encode \b (\010) for escape.
...
[ruby-dev:28927]
* string.c (rb_str_dump): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-02 16:20:16 +00:00
matz
fe6774d691
* string.c: RDoc update for =~ method. a patch from Alex Young
...
<alex at blackkettle.org>. [ruby-core:08068]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-27 14:15:37 +00:00
matz
1b3beecb54
* re.c (rb_reg_initialize): should not modify untainted objects in
...
safe levels higher than 3.
* re.c (rb_memcmp): type change from char* to const void*.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-05-16 00:25:18 +00:00
matz
b66202465a
* string.c (scan_once): wrong condition to use mbclen2().
...
[ruby-dev:27535]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-10-27 08:19:20 +00:00
matz
cc24eb8518
* lib/cgi.rb (CGI::Cookie): should handle multiple values for a
...
cookie name. [ruby-talk:156140]
* string.c (rb_str_substr): should propagate taintness even for
empty strings. [ruby-dev:27121]
* string.c (rb_str_aref): should infect result if range argument
is tainted. [ruby-dev:27121]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-17 14:55:06 +00:00
nobu
64285c5990
* string.c (rb_str_times): make empty strings to keep taintness,
...
and a little improvement. [ruby-dev:26900]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-09 07:35:31 +00:00
ocean
1ac1e06cd5
fixed error on rdoc generation
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-04-20 00:52:28 +00:00
matz
cde930a4a4
* string.c (rb_str_cmp_m): should not return false but nil.
...
fixed: [ruby-dev:25811]
* lib/cgi-lib.rb: add deprecation warning. [ruby-dev:25499]
getopts.rb, parsearg.rb, importenv.rb as well.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-03-07 00:20:16 +00:00
matz
8cdd45d15b
* ext/etc/etc.c (Init_etc): sGroup needs HAVE_ST_GR_PASSWD check.
...
[ruby-dev:25675]
* misc/ruby-mode.el: [ruby-core:04415]
* lib/rdoc/generators/html_generator.rb: [ruby-core:04412]
* lib/rdoc/generators/ri_generator.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-02-12 10:57:22 +00:00
matz
dcd87b140c
* string.c (rb_str_new4): should propagate taintedness.
...
* struct.c (rb_struct_set): use original method name, not callee
name, to retrieve member slot. [ruby-core:04268]
* time.c (time_strftime): protect from format modification from GC
finalizers.
* gc.c (rb_data_object_alloc): klass may be NULL.
[ruby-list:40498]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-01-20 09:34:36 +00:00
matz
ca61cc0b23
* string.c (rb_str_justify): [ruby-dev:25367]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-29 16:05:10 +00:00
nobu
e953a00ab2
* string.c (rb_str_justify): create buffer string after argument type
...
conversion. fixed: [ruby-dev:25341]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-28 13:32:28 +00:00
nobu
947cf31bab
* string.c (rb_str_inspect): escape # which starts an expression
...
substitution. fixed: [ruby-core:03922]
* string.c (rb_str_dump): not escape # which isn't a substitution.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-09 05:38:59 +00:00
matz
f6348ca0ea
* object.c (convert_type): [ruby-core:03845]
...
* eval.c (rb_funcall_rescue): new function.
* object.c (rb_Array): avoid using rb_respond_to().
* object.c (rb_Integer): ditto.
* eval.c (get_backtrace): no conversion for nil.
* parse.y (reduce_nodes): empty body should return nil.
* lib/cgi/session.rb (CGI::Session::initialize): [ruby-core:03832]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7414 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-29 06:13:52 +00:00