Replace calls to `sprintf` and `strcpy` by the safer options `snprintf`
and `safe_strcpy` in the following directories:
- libmysqld
- mysys
- sql-common
- strings
All new code of the whole pull request, including one or several files
that are either new files or modified ones, are contributed under the
BSD-new license. I am contributing on behalf of my employer
Amazon Web Services, Inc.
Added strings_def.h into strings library to be able to have a DBUG_ASSERT() version without _db_flush() call (as strings.a should not depend on dbug.a)
Remove include of m_string.h in all string files (as it's included by string_def.h).
Fixed include order.
Changed "m_ctype.h" -> <m_ctype.h>
include/my_dbug.h:
Flush DBUG log in case of DBUG_ASSERT()
strings/bchange.c:
Include strings_def.h
strings/bcmp.c:
Include strings_def.h
strings/bfill.c:
Include strings_def.h
strings/bmove.c:
Include strings_def.h
strings/bmove512.c:
Include strings_def.h
strings/bmove_upp.c:
Include strings_def.h
strings/conf_to_src.c:
Include strings_def.h
Fixed copyright
strings/ctype-big5.c:
Include strings_def.h
strings/ctype-bin.c:
Include strings_def.h
strings/ctype-cp932.c:
Include strings_def.h
strings/ctype-czech.c:
Include strings_def.h
strings/ctype-euc_kr.c:
Include strings_def.h
strings/ctype-eucjpms.c:
Include strings_def.h
strings/ctype-extra.c:
Include strings_def.h
strings/ctype-gbk.c:
Include strings_def.h
strings/ctype-latin1.c:
Include strings_def.h
strings/ctype-mb.c:
Include strings_def.h
strings/ctype-simple.c:
Include strings_def.h
strings/ctype-sjis.c:
Include strings_def.h
strings/ctype-tis620.c:
Include strings_def.h
strings/ctype-uca.c:
Include strings_def.h
strings/ctype-ucs2.c:
Include strings_def.h
strings/ctype-ujis.c:
Include strings_def.h
strings/ctype-utf8.c:
Include strings_def.h
strings/ctype-win1250ch.c:
Include strings_def.h
strings/ctype.c:
Include strings_def.h
strings/decimal.c:
Include strings_def.h
strings/do_ctype.c:
Include strings_def.h
strings/int2str.c:
Include strings_def.h
strings/is_prefix.c:
Include strings_def.h
strings/llstr.c:
Include strings_def.h
strings/longlong2str.c:
Include strings_def.h
strings/longlong2str_asm.c:
Include strings_def.h
strings/my_strchr.c:
Include strings_def.h
strings/my_strtoll10.c:
Include strings_def.h
strings/my_vsnprintf.c:
Include strings_def.h
strings/r_strinstr.c:
Include strings_def.h
strings/str2int.c:
Include strings_def.h
strings/str_alloc.c:
Include strings_def.h
strings/str_test.c:
Include strings_def.h
Fixed compiler warnings
strings/strappend.c:
Include strings_def.h
strings/strcend.c:
Include strings_def.h
strings/strcont.c:
Include strings_def.h
strings/strend.c:
Include strings_def.h
strings/strfill.c:
Include strings_def.h
strings/strinstr.c:
Include strings_def.h
strings/strmake.c:
Include strings_def.h
strings/strmov.c:
Include strings_def.h
strings/strmov_overlapp.c:
Include strings_def.h
strings/strnlen.c:
Include strings_def.h
strings/strnmov.c:
Include strings_def.h
strings/strstr.c:
Include strings_def.h
strings/strto.c:
Include strings_def.h
strings/strtod.c:
Include strings_def.h
strings/strtol.c:
Include strings_def.h
strings/strtoll.c:
Include strings_def.h
strings/strtoul.c:
Include strings_def.h
strings/strtoull.c:
Include strings_def.h
strings/strxmov.c:
Include strings_def.h
strings/strxnmov.c:
Include strings_def.h
strings/uctypedump.c:
Include strings_def.h
Fixed compiler warnings
Removed double include of m_ctype.h
strings/udiv.c:
Include strings_def.h
strings/xml.c:
Include strings_def.h
Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
Adjusted year(s) in copyright header
Added GPL copyright text
my_vle.h, rpl_utility.h, my_vle.c, base64-t.c, rpl_utility.cc:
Changed copyright header formatting some
plugin_example.c, daemon_example.c:
Added "Copyright (C) 2006 MySQL AB" to GPL header
CMakeLists.txt:
Added GPL copyright text
client/CMakeLists.txt:
Added GPL copyright text
dbug/CMakeLists.txt:
Added GPL copyright text
extra/CMakeLists.txt:
Added GPL copyright text
extra/yassl/CMakeLists.txt:
Added GPL copyright text
extra/yassl/taocrypt/CMakeLists.txt:
Added GPL copyright text
libmysql/CMakeLists.txt:
Added GPL copyright text
libmysqld/CMakeLists.txt:
Added GPL copyright text
libmysqld/examples/CMakeLists.txt:
Added GPL copyright text
mysys/CMakeLists.txt:
Added GPL copyright text
regex/CMakeLists.txt:
Added GPL copyright text
server-tools/instance-manager/CMakeLists.txt:
Added GPL copyright text
sql/CMakeLists.txt:
Added GPL copyright text
storage/archive/CMakeLists.txt:
Added GPL copyright text
storage/blackhole/CMakeLists.txt:
Added GPL copyright text
storage/csv/CMakeLists.txt:
Added GPL copyright text
storage/example/CMakeLists.txt:
Added GPL copyright text
storage/federated/CMakeLists.txt:
Added GPL copyright text
storage/heap/CMakeLists.txt:
Added GPL copyright text
storage/innobase/CMakeLists.txt:
Added GPL copyright text
storage/myisam/CMakeLists.txt:
Added GPL copyright text
storage/myisammrg/CMakeLists.txt:
Added GPL copyright text
strings/CMakeLists.txt:
Added GPL copyright text
tests/CMakeLists.txt:
Added GPL copyright text
vio/CMakeLists.txt:
Added GPL copyright text
zlib/CMakeLists.txt:
Added GPL copyright text
include/my_vle.h:
Changed copyright header formatting some
mysys/my_vle.c:
Changed copyright header formatting some
plugin/daemon_example/daemon_example.c:
Added "Copyright (C) 2006 MySQL AB" to GPL header
plugin/fulltext/plugin_example.c:
Added "Copyright (C) 2006 MySQL AB" to GPL header
plugin/Makefile.am:
Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
Adjusted year(s) in copyright header
sql/authors.h:
Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
Adjusted year(s) in copyright header
sql/contributors.h:
Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
Adjusted year(s) in copyright header
sql/item_xmlfunc.cc:
Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
Adjusted year(s) in copyright header
sql/partition_element.h:
Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
Adjusted year(s) in copyright header
sql/partition_info.h:
Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
Adjusted year(s) in copyright header
sql/rpl_injector.cc:
Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
Adjusted year(s) in copyright header
sql/rpl_injector.h:
Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
Adjusted year(s) in copyright header
sql/sql_binlog.cc:
Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
Adjusted year(s) in copyright header
sql/sql_servers.h:
Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
Adjusted year(s) in copyright header
storage/Makefile.am:
Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
Adjusted year(s) in copyright header
storage/archive/Makefile.am:
Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
Adjusted year(s) in copyright header
storage/blackhole/Makefile.am:
Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
Adjusted year(s) in copyright header
storage/csv/Makefile.am:
Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
Adjusted year(s) in copyright header
storage/example/Makefile.am:
Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
Adjusted year(s) in copyright header
storage/federated/Makefile.am:
Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
Adjusted year(s) in copyright header
win/Makefile.am:
Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
Adjusted year(s) in copyright header
sql/rpl_utility.cc:
Changed copyright header formatting some
sql/rpl_utility.h:
Changed copyright header formatting some
unittest/mysys/base64-t.c:
Changed copyright header formatting some
include/my_uctype.h:
Added GPL copyright text
plugin/daemon_example/Makefile.am:
Added GPL copyright text
plugin/fulltext/Makefile.am:
Added GPL copyright text
scripts/make_win_bin_dist:
Added GPL copyright text
server-tools/instance-manager/user_management_commands.cc:
Added GPL copyright text
sql/sql_builtin.cc.in:
Added GPL copyright text
sql/sql_show.h:
Added GPL copyright text
storage/archive/archive_test.c:
Added GPL copyright text
storage/ndb/src/kernel/blocks/dbtup/test_varpage.cpp:
Added GPL copyright text
storage/ndb/src/kernel/blocks/diskpage.cpp:
Added GPL copyright text
storage/ndb/src/kernel/vm/Rope.cpp:
Added GPL copyright text
storage/ndb/src/mgmsrv/ParamInfo.hpp:
Added GPL copyright text
strings/uctypedump.c:
Added GPL copyright text
unittest/Makefile.am:
Added GPL copyright text
unittest/examples/Makefile.am:
Added GPL copyright text
unittest/examples/core-t.c:
Added GPL copyright text
unittest/examples/no_plan-t.c:
Added GPL copyright text
unittest/examples/simple-t.c:
Added GPL copyright text
unittest/examples/skip-t.c:
Added GPL copyright text
unittest/examples/skip_all-t.c:
Added GPL copyright text
unittest/examples/todo-t.c:
Added GPL copyright text
unittest/mysys/Makefile.am:
Added GPL copyright text
unittest/mytap/Makefile.am:
Added GPL copyright text
unittest/mytap/t/Makefile.am:
Added GPL copyright text
unittest/mytap/t/basic-t.c:
Added GPL copyright text
unittest/unit.pl:
Added GPL copyright text
win/build-vs71.bat:
Added GPL copyright text
win/build-vs8.bat:
Added GPL copyright text
win/configure.js:
Added GPL copyright text
A prerequisite for several fulltext and XML bugs.
MY_CHARSET_HANDLER now has a new function "ctype"
to detect a type of the next character in a string
(i.e. digit, letter, space, punctuation, control, etc),
which now works correctly for both 8bit and multibyte charsets.
Previously only 8bit charsets worked correctly,
while any multibyte character was considered as letter
in multibyte charsets.
Many files:
Adding new function
Makefile.am:
Adding build rules for uctypedump,
a dump tool to create my_uctype.h
using Unicode Character Database file.
m_ctype.h:
Adding declaration of my_uni_ctype,
ctype data for Unicode.
Adding new member into MY_CHARSET_HANDLER
Makefile.am:
Adding my_uctype.h into noinst_HEADERS
my_uctype.h, uctypedump.c:
new files:
ctype data for unicode,
and the tool to generate it from
a Unicode Character Database file.
include/Makefile.am:
Adding my_uctype.h
include/m_ctype.h:
Adding declaration of my_uni_ctype,
ctype data for Unicode.
strings/Makefile.am:
Adding build rules for uctypedump,
a dump tool to create my_uctype.h
using Unicode Character Database file.
strings/ctype-big5.c:
Adding new function
strings/ctype-bin.c:
Adding new function
strings/ctype-cp932.c:
Adding new function
strings/ctype-euc_kr.c:
Adding new function
strings/ctype-eucjpms.c:
Adding new function
strings/ctype-gb2312.c:
Adding new function
strings/ctype-gbk.c:
Adding new function
strings/ctype-latin1.c:
Adding new function
strings/ctype-mb.c:
Adding new function
strings/ctype-simple.c:
Adding new function
strings/ctype-sjis.c:
Adding new function
strings/ctype-tis620.c:
Adding new function
strings/ctype-ucs2.c:
Adding new function
strings/ctype-ujis.c:
Adding new function
strings/ctype-utf8.c:
Adding new function