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
cbbbdb9c
Commit
cbbbdb9c
authored
Feb 18, 2021
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't allocate 64K on the stack
parent
e7d9c1d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
sql/wsrep_notify.cc
sql/wsrep_notify.cc
+7
-3
No files found.
sql/wsrep_notify.cc
View file @
cbbbdb9c
...
@@ -40,11 +40,13 @@ void wsrep_notify_status (wsrep_member_status_t status,
...
@@ -40,11 +40,13 @@ void wsrep_notify_status (wsrep_member_status_t status,
return
;
return
;
}
}
char
cmd_buf
[
1
<<
16
];
// this can be long
const
long
cmd_len
=
(
1
<<
16
)
-
1
;
long
cmd_len
=
sizeof
(
cmd_buf
)
-
1
;
char
*
cmd_ptr
=
(
char
*
)
my_malloc
(
cmd_len
+
1
,
MYF
(
MY_WME
));
char
*
cmd_ptr
=
cmd_buf
;
long
cmd_off
=
0
;
long
cmd_off
=
0
;
if
(
!
cmd_ptr
)
return
;
// the warning is in the log
cmd_off
+=
snprintf
(
cmd_ptr
+
cmd_off
,
cmd_len
-
cmd_off
,
"%s"
,
cmd_off
+=
snprintf
(
cmd_ptr
+
cmd_off
,
cmd_len
-
cmd_off
,
"%s"
,
wsrep_notify_cmd
);
wsrep_notify_cmd
);
...
@@ -93,6 +95,7 @@ void wsrep_notify_status (wsrep_member_status_t status,
...
@@ -93,6 +95,7 @@ void wsrep_notify_status (wsrep_member_status_t status,
{
{
WSREP_ERROR
(
"Notification buffer too short (%ld). Aborting notification."
,
WSREP_ERROR
(
"Notification buffer too short (%ld). Aborting notification."
,
cmd_len
);
cmd_len
);
my_free
(
cmd_ptr
);
return
;
return
;
}
}
...
@@ -106,5 +109,6 @@ void wsrep_notify_status (wsrep_member_status_t status,
...
@@ -106,5 +109,6 @@ void wsrep_notify_status (wsrep_member_status_t status,
WSREP_ERROR
(
"Notification command failed: %d (%s):
\"
%s
\"
"
,
WSREP_ERROR
(
"Notification command failed: %d (%s):
\"
%s
\"
"
,
err
,
strerror
(
err
),
cmd_ptr
);
err
,
strerror
(
err
),
cmd_ptr
);
}
}
my_free
(
cmd_ptr
);
}
}
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