* ruby.c (proc_options): fix pointer overrun. do not advance argv
  until it is valid.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-11-21 09:41:56 +00:00
Родитель 8fdebec088
Коммит c033efddea
2 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Sat Nov 21 18:41:53 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ruby.c (proc_options): fix pointer overrun. do not advance argv
until it is valid.
Sat Nov 21 13:59:09 2015 NARUSE, Yui <naruse@ruby-lang.org>
* ext/digest/sha1/extconf.rb: OpenSSL's struct name for SHA1 is

2
ruby.c
Просмотреть файл

@ -1088,7 +1088,7 @@ proc_options(long argc, char **argv, struct cmdline_options *opt, int envopt)
(((allow_envopt) || !envopt) ? (void)0 : \
rb_raise(rb_eRuntimeError, "invalid switch in RUBYOPT: --" name))
# define need_argument(name, s, needs_arg) \
((*(s)++ ? !*(s) : (!--argc || !((s) = *++argv))) && (needs_arg) ? \
((*(s) ? !*++(s) : (!argc || !((s) = argv[1]) || (--argc, ++argv, 0))) && (needs_arg) ? \
rb_raise(rb_eRuntimeError, "missing argument for --" name) \
: (void)0)
# define is_option_with_arg(name, allow_hyphen, allow_envopt) \