List:Commits« Previous MessageNext Message »
From:Davi Arnaut Date:November 26 2007 12:43pm
Subject:bk commit into 5.0 tree (davi:1.2588) BUG#29592
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of davi. When davi does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-11-26 10:43:39-02:00, davi@stripped +5 -0
  Bug#29592 SQL Injection issue
  
  Remove the mysql_odbc_escape_string() function. The function
  has multi-byte character escaping issues, doesn't honor the
  NO_BACKSLASH_ESCAPES mode and is not used anymore by the
  Connector/ODBC as of 3.51.17.

  include/mysql.h@stripped, 2007-11-26 10:43:33-02:00, davi@stripped +0 -10
    Remove mysql_odbc_escape_string() prototype.

  include/mysql_h.ic@stripped, 2007-11-26 10:43:34-02:00, davi@stripped +0 -2
    Remove mysql_odbc_escape_string()

  libmysql/libmysql.c@stripped, 2007-11-26 10:43:35-02:00, davi@stripped +0 -72
    Remove mysql_odbc_escape_string() body.

  libmysql/libmysql.def@stripped, 2007-11-26 10:43:36-02:00, davi@stripped +0 -1
    Remove mysql_odbc_escape_string()

  libmysqld/libmysqld.def@stripped, 2007-11-26 10:43:36-02:00, davi@stripped +0 -1
    Remove mysql_odbc_escape_string()

diff -Nrup a/include/mysql.h b/include/mysql.h
--- a/include/mysql.h	2007-07-31 23:56:48 -03:00
+++ b/include/mysql.h	2007-11-26 10:43:33 -02:00
@@ -550,16 +550,6 @@ unsigned long STDCALL mysql_real_escape_
 					       char *to,const char *from,
 					       unsigned long length);
 void		STDCALL mysql_debug(const char *debug);
-char *		STDCALL mysql_odbc_escape_string(MYSQL *mysql,
-						 char *to,
-						 unsigned long to_length,
-						 const char *from,
-						 unsigned long from_length,
-						 void *param,
-						 char *
-						 (*extend_buffer)
-						 (void *, char *to,
-						  unsigned long *length));
 void 		STDCALL myodbc_remove_escape(MYSQL *mysql,char *name);
 unsigned int	STDCALL mysql_thread_safe(void);
 my_bool		STDCALL mysql_embedded(void);
diff -Nrup a/include/mysql_h.ic b/include/mysql_h.ic
--- a/include/mysql_h.ic	2006-12-19 07:24:41 -02:00
+++ b/include/mysql_h.ic	2007-11-26 10:43:34 -02:00
@@ -812,8 +812,6 @@ extern unsigned int mysql_num_fields(MYS
 # 400 "mysql.h"
 extern my_ulonglong mysql_num_rows(MYSQL_RES * res);
 # 549 "mysql.h"
-extern char * mysql_odbc_escape_string(MYSQL * mysql, char * to, unsigned long int, char const * from, unsigned long int, void * param, char * (* extend_buffer)(void *, char * to, unsigned long int * length));
-# 527 "mysql.h"
 extern int mysql_options(MYSQL * mysql, enum mysql_option, char const * arg);
 # 516 "mysql.h"
 extern int mysql_ping(MYSQL * mysql);
diff -Nrup a/libmysql/libmysql.c b/libmysql/libmysql.c
--- a/libmysql/libmysql.c	2007-10-30 10:41:20 -02:00
+++ b/libmysql/libmysql.c	2007-11-26 10:43:35 -02:00
@@ -1617,78 +1617,6 @@ mysql_real_escape_string(MYSQL *mysql, c
   return escape_string_for_mysql(mysql->charset, to, 0, from, length);
 }
 
-
-char * STDCALL
-mysql_odbc_escape_string(MYSQL *mysql,
-			 char *to, ulong to_length,
-			 const char *from, ulong from_length,
-			 void *param,
-			 char * (*extend_buffer)
-			 (void *, char *, ulong *))
-{
-  char *to_end=to+to_length-5;
-  const char *end;
-#ifdef USE_MB
-  my_bool use_mb_flag=use_mb(mysql->charset);
-#endif
-
-  for (end=from+from_length; from != end ; from++)
-  {
-    if (to >= to_end)
-    {
-      to_length = (ulong) (end-from)+512;	/* We want this much more */
-      if (!(to=(*extend_buffer)(param, to, &to_length)))
-	return to;
-      to_end=to+to_length-5;
-    }
-#ifdef USE_MB
-    {
-      int l;
-      if (use_mb_flag && (l = my_ismbchar(mysql->charset, from, end)))
-      {
-	while (l--)
-	  *to++ = *from++;
-	from--;
-	continue;
-      }
-    }
-#endif
-    switch (*from) {
-    case 0:				/* Must be escaped for 'mysql' */
-      *to++= '\\';
-      *to++= '0';
-      break;
-    case '\n':				/* Must be escaped for logs */
-      *to++= '\\';
-      *to++= 'n';
-      break;
-    case '\r':
-      *to++= '\\';
-      *to++= 'r';
-      break;
-    case '\\':
-      *to++= '\\';
-      *to++= '\\';
-      break;
-    case '\'':
-      *to++= '\\';
-      *to++= '\'';
-      break;
-    case '"':				/* Better safe than sorry */
-      *to++= '\\';
-      *to++= '"';
-      break;
-    case '\032':			/* This gives problems on Win32 */
-      *to++= '\\';
-      *to++= 'Z';
-      break;
-    default:
-      *to++= *from;
-    }
-  }
-  return to;
-}
-
 void STDCALL
 myodbc_remove_escape(MYSQL *mysql,char *name)
 {
diff -Nrup a/libmysql/libmysql.def b/libmysql/libmysql.def
--- a/libmysql/libmysql.def	2007-02-22 12:59:54 -02:00
+++ b/libmysql/libmysql.def	2007-11-26 10:43:36 -02:00
@@ -78,7 +78,6 @@ EXPORTS
 	mysql_next_result
 	mysql_num_fields
 	mysql_num_rows
-	mysql_odbc_escape_string
 	mysql_options
 	mysql_stmt_param_count
 	mysql_stmt_param_metadata
diff -Nrup a/libmysqld/libmysqld.def b/libmysqld/libmysqld.def
--- a/libmysqld/libmysqld.def	2007-06-18 14:21:42 -03:00
+++ b/libmysqld/libmysqld.def	2007-11-26 10:43:36 -02:00
@@ -71,7 +71,6 @@ EXPORTS
 	mysql_next_result
 	mysql_num_fields
 	mysql_num_rows
-	mysql_odbc_escape_string
 	mysql_options
 	mysql_ping
 	mysql_query
Thread
bk commit into 5.0 tree (davi:1.2588) BUG#29592Davi Arnaut26 Nov
  • Re: bk commit into 5.0 tree (davi:1.2588) BUG#29592Konstantin Osipov26 Nov