Skip to content

Commit c542717

Browse files
author
Aditya A
committed
Bug #26275510 BUNDLED ZLIB DOESN'T INCLUDE FIXES FOR SOME VULNERABILITIES
Upgrading the zlib lib to 1.2.11
1 parent 28b0521 commit c542717

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+13915
-3417
lines changed

CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2006, 2018, 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 as published by
@@ -382,6 +382,12 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/include)
382382

383383
# Add bundled or system zlib.
384384
MYSQL_CHECK_ZLIB_WITH_COMPRESS()
385+
IF(BUILD_BUNDLED_ZLIB)
386+
INCLUDE_DIRECTORIES(SYSTEM
387+
${CMAKE_CURRENT_SOURCE_DIR}/zlib
388+
${CMAKE_CURRENT_BINARY_DIR}/zlib
389+
)
390+
ENDIF()
385391
# Optionally add bundled yassl/taocrypt or system openssl.
386392
MYSQL_CHECK_SSL()
387393
# Add readline or libedit.

client/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2006, 2018, 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 as published by
@@ -15,7 +15,6 @@
1515

1616
INCLUDE_DIRECTORIES(
1717
${CMAKE_SOURCE_DIR}/include
18-
${ZLIB_INCLUDE_DIR}
1918
${SSL_INCLUDE_DIRS}
2019
${CMAKE_SOURCE_DIR}/libmysql
2120
${CMAKE_SOURCE_DIR}/regex

client/mysql.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2671,7 +2671,7 @@ You can turn off this feature to get a quicker startup with -A\n\n");
26712671
mysql_free_result(fields);
26722672
break;
26732673
}
2674-
field_names[i][num_fields*2]= NULL;
2674+
field_names[i][num_fields*2]= '\0';
26752675
j=0;
26762676
while ((sql_field=mysql_fetch_field(fields)))
26772677
{

cmake/plugin.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2009, 2018, 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 as published by
@@ -56,7 +56,7 @@ MACRO(MYSQL_ADD_PLUGIN)
5656
${CMAKE_SOURCE_DIR}/sql
5757
${CMAKE_SOURCE_DIR}/regex
5858
${SSL_INCLUDE_DIRS}
59-
${ZLIB_INCLUDE_DIR})
59+
)
6060

6161
LIST(GET ARG_DEFAULT_ARGS 0 plugin)
6262
SET(SOURCES ${ARG_DEFAULT_ARGS})

cmake/zlib.cmake

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2009, 2018, 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 as published by
@@ -14,15 +14,11 @@
1414
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1515

1616
MACRO (MYSQL_USE_BUNDLED_ZLIB)
17-
SET(ZLIB_LIBRARY zlib)
18-
SET(ZLIB_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/zlib)
17+
SET(BUILD_BUNDLED_ZLIB 1)
18+
SET(ZLIB_LIBRARY zlib CACHE INTERNAL "Bundled zlib library")
1919
SET(ZLIB_FOUND TRUE)
2020
SET(WITH_ZLIB "bundled" CACHE STRING "Use bundled zlib")
2121
ADD_SUBDIRECTORY(zlib)
22-
GET_TARGET_PROPERTY(src zlib SOURCES)
23-
FOREACH(file ${src})
24-
SET(ZLIB_SOURCES ${ZLIB_SOURCES} ${CMAKE_SOURCE_DIR}/zlib/${file})
25-
ENDFOREACH()
2622
ENDMACRO()
2723

2824
# MYSQL_CHECK_ZLIB_WITH_COMPRESS
@@ -37,15 +33,10 @@ ENDMACRO()
3733

3834
MACRO (MYSQL_CHECK_ZLIB_WITH_COMPRESS)
3935

40-
IF(CMAKE_SYSTEM_NAME STREQUAL "OS400" OR
41-
CMAKE_SYSTEM_NAME STREQUAL "AIX" OR
42-
CMAKE_SYSTEM_NAME STREQUAL "Windows")
43-
# Use bundled zlib on some platforms by default (system one is too
44-
# old or not existent)
36+
# For NDBCLUSTER: Use bundled zlib by default
4537
IF (NOT WITH_ZLIB)
4638
SET(WITH_ZLIB "bundled" CACHE STRING "By default use bundled zlib on this platform")
4739
ENDIF()
48-
ENDIF()
4940

5041
IF(WITH_ZLIB STREQUAL "bundled")
5142
MYSQL_USE_BUNDLED_ZLIB()

extra/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2006, 2018, 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 as published by
@@ -15,7 +15,6 @@
1515

1616
INCLUDE_DIRECTORIES(
1717
${CMAKE_SOURCE_DIR}/include
18-
${ZLIB_INCLUDE_DIR}
1918
# Following is for perror, in case NDB is compiled in.
2019
${CMAKE_SOURCE_DIR}/storage/ndb/include
2120
${CMAKE_SOURCE_DIR}/storage/ndb/include/util

libmysql/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2006, 2018, 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 as published by
@@ -21,7 +21,7 @@ INCLUDE_DIRECTORIES(
2121
${CMAKE_SOURCE_DIR}/strings
2222
${SSL_INCLUDE_DIRS}
2323
${SSL_INTERNAL_INCLUDE_DIRS}
24-
${ZLIB_INCLUDE_DIR})
24+
)
2525
ADD_DEFINITIONS(${SSL_DEFINES})
2626

2727
SET(CLIENT_API_FUNCTIONS

libmysqld/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2006, 2018, 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 as published by
@@ -23,7 +23,6 @@ ${CMAKE_SOURCE_DIR}/libmysqld
2323
${CMAKE_SOURCE_DIR}/sql
2424
${CMAKE_BINARY_DIR}/sql
2525
${CMAKE_SOURCE_DIR}/regex
26-
${ZLIB_INCLUDE_DIR}
2726
${SSL_INCLUDE_DIRS}
2827
${SSL_INTERNAL_INCLUDE_DIRS}
2928
${CMAKE_SOURCE_DIR}/sql/backup

mysys/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2006, 2018, 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 as published by
@@ -13,7 +13,7 @@
1313
# along with this program; if not, write to the Free Software
1414
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1515

16-
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/mysys)
16+
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/mysys)
1717

1818
SET(MYSYS_SOURCES array.c charset-def.c charset.c checksum.c default.c
1919
errors.c hash.c list.c md5.c mf_cache.c mf_dirname.c mf_fn_ext.c

sql/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2006, 2018, 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 as published by
@@ -17,7 +17,6 @@ INCLUDE_DIRECTORIES(
1717
${CMAKE_SOURCE_DIR}/include
1818
${CMAKE_SOURCE_DIR}/sql
1919
${CMAKE_SOURCE_DIR}/regex
20-
${ZLIB_INCLUDE_DIR}
2120
${SSL_INCLUDE_DIRS}
2221
${CMAKE_BINARY_DIR}/sql
2322
)

0 commit comments

Comments
 (0)