Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
2cbf2e64
Commit
2cbf2e64
authored
Nov 29, 2012
by
unknown
Committed by
Akhil Mohan
Nov 29, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
applying patch for BUG15912213
parent
86c0a80b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletion
+20
-1
sql/sql_acl.cc
sql/sql_acl.cc
+20
-1
No files found.
sql/sql_acl.cc
View file @
2cbf2e64
...
@@ -1356,10 +1356,19 @@ ulong acl_get(const char *host, const char *ip,
...
@@ -1356,10 +1356,19 @@ ulong acl_get(const char *host, const char *ip,
{
{
ulong
host_access
=
~
(
ulong
)
0
,
db_access
=
0
;
ulong
host_access
=
~
(
ulong
)
0
,
db_access
=
0
;
uint
i
;
uint
i
;
size_t
key_length
;
size_t
key_length
,
copy_length
;
char
key
[
ACL_KEY_LENGTH
],
*
tmp_db
,
*
end
;
char
key
[
ACL_KEY_LENGTH
],
*
tmp_db
,
*
end
;
acl_entry
*
entry
;
acl_entry
*
entry
;
DBUG_ENTER
(
"acl_get"
);
DBUG_ENTER
(
"acl_get"
);
copy_length
=
(
size_t
)
(
strlen
(
ip
?
ip
:
""
)
+
strlen
(
user
?
user
:
""
)
+
strlen
(
db
?
db
:
""
));
/*
Make sure that strmov() operations do not result in buffer overflow.
*/
if
(
copy_length
>=
ACL_KEY_LENGTH
)
DBUG_RETURN
(
0
);
VOID
(
pthread_mutex_lock
(
&
acl_cache
->
lock
));
VOID
(
pthread_mutex_lock
(
&
acl_cache
->
lock
));
end
=
strmov
((
tmp_db
=
strmov
(
strmov
(
key
,
ip
?
ip
:
""
)
+
1
,
user
)
+
1
),
db
);
end
=
strmov
((
tmp_db
=
strmov
(
strmov
(
key
,
ip
?
ip
:
""
)
+
1
,
user
)
+
1
),
db
);
...
@@ -4340,6 +4349,16 @@ bool check_grant_db(THD *thd,const char *db)
...
@@ -4340,6 +4349,16 @@ bool check_grant_db(THD *thd,const char *db)
char
helping
[
NAME_LEN
+
USERNAME_LENGTH
+
2
];
char
helping
[
NAME_LEN
+
USERNAME_LENGTH
+
2
];
uint
len
;
uint
len
;
bool
error
=
TRUE
;
bool
error
=
TRUE
;
size_t
copy_length
;
copy_length
=
(
size_t
)
(
strlen
(
sctx
->
priv_user
?
sctx
->
priv_user
:
""
)
+
strlen
(
db
?
db
:
""
));
/*
Make sure that strmov() operations do not result in buffer overflow.
*/
if
(
copy_length
>=
(
NAME_LEN
+
USERNAME_LENGTH
+
2
))
return
1
;
len
=
(
uint
)
(
strmov
(
strmov
(
helping
,
sctx
->
priv_user
)
+
1
,
db
)
-
helping
)
+
1
;
len
=
(
uint
)
(
strmov
(
strmov
(
helping
,
sctx
->
priv_user
)
+
1
,
db
)
-
helping
)
+
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment