* 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:
parent
256eae162c
commit
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>
|
Fri Jul 22 13:55:59 2011 Eric Hodel <drbrain@segment7.net>
|
||||||
|
|
||||||
* lib/net/http.rb: Net::HTTP#finish is used to manually close
|
* 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;
|
const char *e = m + len;
|
||||||
int localid = FALSE;
|
int localid = FALSE;
|
||||||
|
|
||||||
if (!m) return FALSE;
|
if (!m || len <= 0) return FALSE;
|
||||||
switch (*m) {
|
switch (*m) {
|
||||||
case '\0':
|
case '\0':
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -9738,8 +9738,8 @@ rb_enc_symname2_p(const char *name, long len, rb_encoding *enc)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case '!':
|
case '!':
|
||||||
|
if (len == 1) return FALSE;
|
||||||
switch (*++m) {
|
switch (*++m) {
|
||||||
case '\0': return TRUE;
|
|
||||||
case '=': case '~': ++m; break;
|
case '=': case '~': ++m; break;
|
||||||
default: return FALSE;
|
default: return FALSE;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user