summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorunknown <joerg@trift2.>2008-01-28 15:16:40 +0100
committerunknown <joerg@trift2.>2008-01-28 15:16:40 +0100
commit69338e08c0ec776338806f810751e4a4923a96d6 (patch)
treef31d846adbd71f7ec039800ea45b4d9ee6e630e6 /extra
parent4bacd53715ac860c6ba2d9c148f87d22cae9c62a (diff)
parent66361a8090dfef929ea47a2f1e7b628a72956649 (diff)
downloadmariadb-git-69338e08c0ec776338806f810751e4a4923a96d6.tar.gz
Merge trift2.:/MySQL/M51/mysql-5.1
into trift2.:/MySQL/M51/push-5.1 configure.in: Auto merged extra/CMakeLists.txt: Auto merged extra/resolveip.c: Auto merged mysql-test/t/disabled.def: Auto merged
Diffstat (limited to 'extra')
-rwxr-xr-xextra/CMakeLists.txt3
-rw-r--r--extra/resolveip.c14
-rw-r--r--extra/yassl/src/handshake.cpp5
-rw-r--r--extra/yassl/src/template_instnt.cpp1
-rw-r--r--extra/yassl/src/yassl_imp.cpp11
5 files changed, 27 insertions, 7 deletions
diff --git a/extra/CMakeLists.txt b/extra/CMakeLists.txt
index 42561a97888..cec0db6a4ae 100755
--- a/extra/CMakeLists.txt
+++ b/extra/CMakeLists.txt
@@ -44,6 +44,9 @@ TARGET_LINK_LIBRARIES(my_print_defaults strings mysys debug dbug taocrypt wsock3
ADD_EXECUTABLE(perror perror.c)
TARGET_LINK_LIBRARIES(perror strings mysys debug dbug wsock32)
+ADD_EXECUTABLE(resolveip resolveip.c)
+TARGET_LINK_LIBRARIES(resolveip strings mysys debug dbug wsock32)
+
ADD_EXECUTABLE(replace replace.c)
TARGET_LINK_LIBRARIES(replace strings mysys debug dbug wsock32)
diff --git a/extra/resolveip.c b/extra/resolveip.c
index e5fede7fda8..9f936fa60b4 100644
--- a/extra/resolveip.c
+++ b/extra/resolveip.c
@@ -21,13 +21,15 @@
#include <m_ctype.h>
#include <my_sys.h>
#include <m_string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#ifndef HAVE_BROKEN_NETINET_INCLUDES
-#include <netinet/in.h>
+#ifndef WIN32
+# include <sys/types.h>
+# include <sys/socket.h>
+# ifndef HAVE_BROKEN_NETINET_INCLUDES
+# include <netinet/in.h>
+# endif
+# include <arpa/inet.h>
+# include <netdb.h>
#endif
-#include <arpa/inet.h>
-#include <netdb.h>
#include <my_net.h>
#include <my_getopt.h>
diff --git a/extra/yassl/src/handshake.cpp b/extra/yassl/src/handshake.cpp
index 1d5a95820bb..262b5cb3b8b 100644
--- a/extra/yassl/src/handshake.cpp
+++ b/extra/yassl/src/handshake.cpp
@@ -527,6 +527,11 @@ void ProcessOldClientHello(input_buffer& input, SSL& ssl)
input.read(len, sizeof(len));
uint16 randomLen;
ato16(len, randomLen);
+ if (ch.suite_len_ > MAX_SUITE_SZ || sessionLen > ID_LEN ||
+ randomLen > RAN_LEN) {
+ ssl.SetError(bad_input);
+ return;
+ }
int j = 0;
for (uint16 i = 0; i < ch.suite_len_; i += 3) {
diff --git a/extra/yassl/src/template_instnt.cpp b/extra/yassl/src/template_instnt.cpp
index f82f7924359..fe3a251b865 100644
--- a/extra/yassl/src/template_instnt.cpp
+++ b/extra/yassl/src/template_instnt.cpp
@@ -101,6 +101,7 @@ template void ysArrayDelete<unsigned char>(unsigned char*);
template void ysArrayDelete<char>(char*);
template int min<int>(int, int);
+template uint16 min<uint16>(uint16, uint16);
template unsigned int min<unsigned int>(unsigned int, unsigned int);
template unsigned long min<unsigned long>(unsigned long, unsigned long);
}
diff --git a/extra/yassl/src/yassl_imp.cpp b/extra/yassl/src/yassl_imp.cpp
index 0bc95f64abc..b43d9c27355 100644
--- a/extra/yassl/src/yassl_imp.cpp
+++ b/extra/yassl/src/yassl_imp.cpp
@@ -621,6 +621,10 @@ void HandShakeHeader::Process(input_buffer& input, SSL& ssl)
}
uint len = c24to32(length_);
+ if (len > input.get_remaining()) {
+ ssl.SetError(bad_input);
+ return;
+ }
hashHandShake(ssl, input, len);
hs->set_length(len);
@@ -1391,10 +1395,15 @@ input_buffer& operator>>(input_buffer& input, ClientHello& hello)
// Suites
byte tmp[2];
+ uint16 len;
tmp[0] = input[AUTO];
tmp[1] = input[AUTO];
- ato16(tmp, hello.suite_len_);
+ ato16(tmp, len);
+
+ hello.suite_len_ = min(len, static_cast<uint16>(MAX_SUITE_SZ));
input.read(hello.cipher_suites_, hello.suite_len_);
+ if (len > hello.suite_len_) // ignore extra suites
+ input.set_current(input.get_current() + len - hello.suite_len_);
// Compression
hello.comp_len_ = input[AUTO];