зеркало из https://github.com/github/ruby.git
* parse.y (rb_enc_symname2_p): get rid of potential out-of-bound
access. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
256eae162c
Коммит
e0060732f1
|
@ -1,3 +1,8 @@
|
|||
Fri Jul 22 19:05:47 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* parse.y (rb_enc_symname2_p): get rid of potential out-of-bound
|
||||
access.
|
||||
|
||||
Fri Jul 22 13:55:59 2011 Eric Hodel <drbrain@segment7.net>
|
||||
|
||||
* lib/net/http.rb: Net::HTTP#finish is used to manually close
|
||||
|
|
4
parse.y
4
parse.y
|
@ -9685,7 +9685,7 @@ rb_enc_symname2_p(const char *name, long len, rb_encoding *enc)
|
|||
const char *e = m + len;
|
||||
int localid = FALSE;
|
||||
|
||||
if (!m) return FALSE;
|
||||
if (!m || len <= 0) return FALSE;
|
||||
switch (*m) {
|
||||
case '\0':
|
||||
return FALSE;
|
||||
|
@ -9738,8 +9738,8 @@ rb_enc_symname2_p(const char *name, long len, rb_encoding *enc)
|
|||
break;
|
||||
|
||||
case '!':
|
||||
if (len == 1) return FALSE;
|
||||
switch (*++m) {
|
||||
case '\0': return TRUE;
|
||||
case '=': case '~': ++m; break;
|
||||
default: return FALSE;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче