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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
c15c2704
Commit
c15c2704
authored
Nov 17, 2005
by
eric@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix potential security hole, pointed out by Sergei. Also simplify code per Sergei's suggestion.
parent
a316a30d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
7 deletions
+3
-7
sql/ha_federated.cc
sql/ha_federated.cc
+3
-6
sql/ha_federated.h
sql/ha_federated.h
+0
-1
No files found.
sql/ha_federated.cc
View file @
c15c2704
...
@@ -2616,10 +2616,8 @@ int ha_federated::stash_remote_error()
...
@@ -2616,10 +2616,8 @@ int ha_federated::stash_remote_error()
DBUG_ENTER
(
"ha_federated::stash_remote_error()"
);
DBUG_ENTER
(
"ha_federated::stash_remote_error()"
);
remote_error_number
=
mysql_errno
(
mysql
);
remote_error_number
=
mysql_errno
(
mysql
);
const
char
*
remote_error
=
mysql_error
(
mysql
);
const
char
*
remote_error
=
mysql_error
(
mysql
);
remote_error_len
=
strlen
(
remote_error
);
my_snprintf
(
remote_error_buf
,
sizeof
(
remote_error_buf
),
"%s"
,
if
(
remote_error_len
>
(
sizeof
(
remote_error_buf
)
-
1
))
mysql_error
(
mysql
));
remote_error_len
=
(
sizeof
(
remote_error_buf
)
-
1
);
my_snprintf
(
remote_error_buf
,
remote_error_len
+
1
,
remote_error
);
DBUG_RETURN
(
HA_FEDERATED_ERROR_WITH_REMOTE_SYSTEM
);
DBUG_RETURN
(
HA_FEDERATED_ERROR_WITH_REMOTE_SYSTEM
);
}
}
...
@@ -2633,11 +2631,10 @@ bool ha_federated::get_error_message(int error, String* buf)
...
@@ -2633,11 +2631,10 @@ bool ha_federated::get_error_message(int error, String* buf)
buf
->
append
(
"Error on remote system: "
);
buf
->
append
(
"Error on remote system: "
);
buf
->
qs_append
(
remote_error_number
);
buf
->
qs_append
(
remote_error_number
);
buf
->
append
(
": "
);
buf
->
append
(
": "
);
buf
->
append
(
remote_error_buf
,
remote_error_len
);
buf
->
append
(
remote_error_buf
);
remote_error_number
=
0
;
remote_error_number
=
0
;
remote_error_buf
[
0
]
=
'\0'
;
remote_error_buf
[
0
]
=
'\0'
;
remote_error_len
=
0
;
}
}
DBUG_PRINT
(
"exit"
,
(
"message: %s"
,
buf
->
ptr
()));
DBUG_PRINT
(
"exit"
,
(
"message: %s"
,
buf
->
ptr
()));
DBUG_RETURN
(
FALSE
);
DBUG_RETURN
(
FALSE
);
...
...
sql/ha_federated.h
View file @
c15c2704
...
@@ -159,7 +159,6 @@ class ha_federated: public handler
...
@@ -159,7 +159,6 @@ class ha_federated: public handler
MYSQL_ROW_OFFSET
current_position
;
// Current position used by ::position()
MYSQL_ROW_OFFSET
current_position
;
// Current position used by ::position()
int
remote_error_number
;
int
remote_error_number
;
char
remote_error_buf
[
FEDERATED_QUERY_BUFFER_SIZE
];
char
remote_error_buf
[
FEDERATED_QUERY_BUFFER_SIZE
];
uint
remote_error_len
;
private:
private:
/*
/*
...
...
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