Skip to content

Commit c0906f2

Browse files
author
Anushree Prakash B
committed
Merge branch 'mysql-5.7' into mysql-8.0
2 parents 25a67c6 + f6623ab commit c0906f2

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

libbinlogevents/src/control_events.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License, version 2.0,
@@ -596,7 +596,8 @@ View_change_event::View_change_event(char *raw_view_id)
596596
view_id(),
597597
seq_number(0),
598598
certification_info() {
599-
memcpy(view_id, raw_view_id, strlen(raw_view_id));
599+
strncpy(view_id, raw_view_id, sizeof(view_id) - 1);
600+
view_id[sizeof(view_id) - 1] = 0;
600601
}
601602

602603
View_change_event::View_change_event(const char *buffer,

libmysql/authentication_win/common.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License, version 2.0,
@@ -468,7 +468,7 @@ const char *get_last_error_message(Error_message_buf buf) {
468468
buf[0] = '\0';
469469
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, error,
470470
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)buf,
471-
sizeof(buf), NULL);
471+
sizeof(Error_message_buf), NULL);
472472

473473
return buf;
474474
}

0 commit comments

Comments
 (0)