Commit d543e4f1 authored by unknown's avatar unknown

Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.1-build

into  ramayana.hindu.god:/home/tsmith/m/bk/build/51

parents 0c7c8214 b27c827b
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#endif #endif
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# include <config.h> # include "config_readline.h"
#endif #endif
#include <stdio.h> #include <stdio.h>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#define READLINE_LIBRARY #define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# include <config.h> # include "config_readline.h"
#endif #endif
#include "rlconf.h" #include "rlconf.h"
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#define READLINE_LIBRARY #define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# include <config.h> # include "config_readline.h"
#endif #endif
#include <stdio.h> #include <stdio.h>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#define READLINE_LIBRARY #define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# include <config.h> # include "config_readline.h"
#endif #endif
#include <sys/types.h> #include <sys/types.h>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#define READLINE_LIBRARY #define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# include <config.h> # include "config_readline.h"
#endif #endif
#include <sys/types.h> #include <sys/types.h>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#define READLINE_LIBRARY #define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# include <config.h> # include "config_readline.h"
#endif #endif
#if !defined (BUFSIZ) #if !defined (BUFSIZ)
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#define READLINE_LIBRARY #define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# include <config.h> # include "config_readline.h"
#endif #endif
#include <stdio.h> #include <stdio.h>
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#endif #endif
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# include <config.h> # include "config_readline.h"
#endif #endif
#include <stdio.h> #include <stdio.h>
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#define READLINE_LIBRARY #define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# include <config.h> # include "config_readline.h"
#endif #endif
#include <stdio.h> #include <stdio.h>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#define READLINE_LIBRARY #define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# include <config.h> # include "config_readline.h"
#endif #endif
#include <stdio.h> #include <stdio.h>
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#endif #endif
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# include <config.h> # include "config_readline.h"
#endif #endif
#include <sys/types.h> #include <sys/types.h>
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#define READLINE_LIBRARY #define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# include <config.h> # include "config_readline.h"
#endif #endif
#include <sys/types.h> #include <sys/types.h>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#define READLINE_LIBRARY #define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# include <config.h> # include "config_readline.h"
#endif #endif
#if defined (HAVE_STDLIB_H) #if defined (HAVE_STDLIB_H)
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#define READLINE_LIBRARY #define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# include <config.h> # include "config_readline.h"
#endif #endif
#include <sys/types.h> #include <sys/types.h>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#define READLINE_LIBRARY #define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# include <config.h> # include "config_readline.h"
#endif #endif
#include <sys/types.h> #include <sys/types.h>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#define READLINE_LIBRARY #define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# include <config.h> # include "config_readline.h"
#endif #endif
#include <sys/types.h> #include <sys/types.h>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#define READLINE_LIBRARY #define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# include <config.h> # include "config_readline.h"
#endif #endif
#if defined (HAVE_UNISTD_H) #if defined (HAVE_UNISTD_H)
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#define READLINE_LIBRARY #define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# include <config.h> # include "config_readline.h"
#endif #endif
#include <sys/types.h> #include <sys/types.h>
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include "rlconf.h" #include "rlconf.h"
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# include <config.h> # include "config_readline.h"
#endif #endif
#include <stdio.h> #include <stdio.h>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#define READLINE_LIBRARY #define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# include <config.h> # include "config_readline.h"
#endif #endif
#include <sys/types.h> #include <sys/types.h>
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#define _RLDEFS_H_ #define _RLDEFS_H_
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# include "config.h" # include "config_readline.h"
#endif #endif
#include "rlstdc.h" #include "rlstdc.h"
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#define READLINE_LIBRARY #define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# include <config.h> # include "config_readline.h"
#endif #endif
#include <sys/types.h> #include <sys/types.h>
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#define _RLWINSIZE_H_ #define _RLWINSIZE_H_
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# include "config.h" # include "config_readline.h"
#endif #endif
/* Try to find the definitions of `struct winsize' and TIOGCWINSZ */ /* Try to find the definitions of `struct winsize' and TIOGCWINSZ */
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
59 Temple Place, Suite 330, Boston, MA 02111 USA. */ 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY #define READLINE_LIBRARY
#include <config.h> #include "config_readline.h"
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H
# include <string.h> # include <string.h>
#endif #endif
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#define READLINE_LIBRARY #define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# include <config.h> # include "config_readline.h"
#endif #endif
#include <sys/types.h> #include <sys/types.h>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#define READLINE_LIBRARY #define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# include <config.h> # include "config_readline.h"
#endif #endif
#include <sys/types.h> #include <sys/types.h>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#define READLINE_LIBRARY #define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# include <config.h> # include "config_readline.h"
#endif #endif
#include <stdio.h> /* Just for NULL. Yuck. */ #include <stdio.h> /* Just for NULL. Yuck. */
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#define _RLTCAP_H_ #define _RLTCAP_H_
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# include "config.h" # include "config_readline.h"
#endif #endif
#if defined (HAVE_TERMCAP_H) #if defined (HAVE_TERMCAP_H)
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#define READLINE_LIBRARY #define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# include <config.h> # include "config_readline.h"
#endif #endif
#include <sys/types.h> #include <sys/types.h>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#define READLINE_LIBRARY #define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# include <config.h> # include "config_readline.h"
#endif #endif
#if defined (HAVE_UNISTD_H) #if defined (HAVE_UNISTD_H)
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# include <config.h> # include "config_readline.h"
#endif #endif
#if defined (HAVE_UNISTD_H) #if defined (HAVE_UNISTD_H)
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#define READLINE_LIBRARY #define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# include <config.h> # include "config_readline.h"
#endif #endif
#include <sys/types.h> #include <sys/types.h>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#define READLINE_LIBRARY #define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# include <config.h> # include "config_readline.h"
#endif #endif
#include <sys/types.h> #include <sys/types.h>
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#if defined (VI_MODE) #if defined (VI_MODE)
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
# include <config.h> # include "config_readline.h"
#endif #endif
#include <sys/types.h> #include <sys/types.h>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#define READLINE_LIBRARY #define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H) #if defined (HAVE_CONFIG_H)
#include <config.h> #include "config_readline.h"
#endif #endif
#include <stdio.h> #include <stdio.h>
......
...@@ -527,6 +527,11 @@ void ProcessOldClientHello(input_buffer& input, SSL& ssl) ...@@ -527,6 +527,11 @@ void ProcessOldClientHello(input_buffer& input, SSL& ssl)
input.read(len, sizeof(len)); input.read(len, sizeof(len));
uint16 randomLen; uint16 randomLen;
ato16(len, 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; int j = 0;
for (uint16 i = 0; i < ch.suite_len_; i += 3) { for (uint16 i = 0; i < ch.suite_len_; i += 3) {
......
...@@ -101,6 +101,7 @@ template void ysArrayDelete<unsigned char>(unsigned char*); ...@@ -101,6 +101,7 @@ template void ysArrayDelete<unsigned char>(unsigned char*);
template void ysArrayDelete<char>(char*); template void ysArrayDelete<char>(char*);
template int min<int>(int, int); template int min<int>(int, int);
template uint16 min<uint16>(uint16, uint16);
template unsigned int min<unsigned int>(unsigned int, unsigned int); template unsigned int min<unsigned int>(unsigned int, unsigned int);
template unsigned long min<unsigned long>(unsigned long, unsigned long); template unsigned long min<unsigned long>(unsigned long, unsigned long);
} }
......
...@@ -621,6 +621,10 @@ void HandShakeHeader::Process(input_buffer& input, SSL& ssl) ...@@ -621,6 +621,10 @@ void HandShakeHeader::Process(input_buffer& input, SSL& ssl)
} }
uint len = c24to32(length_); uint len = c24to32(length_);
if (len > input.get_remaining()) {
ssl.SetError(bad_input);
return;
}
hashHandShake(ssl, input, len); hashHandShake(ssl, input, len);
hs->set_length(len); hs->set_length(len);
...@@ -1391,10 +1395,15 @@ input_buffer& operator>>(input_buffer& input, ClientHello& hello) ...@@ -1391,10 +1395,15 @@ input_buffer& operator>>(input_buffer& input, ClientHello& hello)
// Suites // Suites
byte tmp[2]; byte tmp[2];
uint16 len;
tmp[0] = input[AUTO]; tmp[0] = input[AUTO];
tmp[1] = 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_); 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 // Compression
hello.comp_len_ = input[AUTO]; hello.comp_len_ = input[AUTO];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment