Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

MDEV-36245 - Long server_audit_file_path causes buffer overflow #3874

Open
wants to merge 1 commit into
base: 10.5
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions plugin/server_audit/server_audit.c
Original file line number Diff line number Diff line change
@@ -2836,6 +2836,14 @@ static void update_file_path(MYSQL_THD thd,
{
char *new_name= (*(char **) save) ? *(char **) save : empty_str;

if (strlen(new_name) + 4 > FN_REFLEN)
{
error_header();
fprintf(stderr, "server_audit_file_path can't exceed %d characters.\n", FN_REFLEN - 4);
CLIENT_ERROR(1, "server_audit_file_path can't exceed %d characters.\n", MYF(ME_WARNING), FN_REFLEN - 4);
return;
}

ADD_ATOMIC(internal_stop_logging, 1);
error_header();
fprintf(stderr, "Log file name was changed to '%s'.\n", new_name);