Commit:    740b823be80a29e4c6537d4053eb7bad0fae6c41
Author:    Andrey Hristov <and...@php.net>         Mon, 4 Feb 2013 14:27:56 
+0100
Parents:   643ce95b5bd80e744c7f5e6ac33138f40ed9a1f7
Branches:  PHP-5.4 PHP-5.5 master

Link:       
http://git.php.net/?p=php-src.git;a=commitdiff;h=740b823be80a29e4c6537d4053eb7bad0fae6c41

Log:
check the validity of the parameter

Changed paths:
  M  ext/mysqlnd/mysqlnd.c


Diff:
diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c
index 0b81ac9..90c2b73 100644
--- a/ext/mysqlnd/mysqlnd.c
+++ b/ext/mysqlnd/mysqlnd.c
@@ -2321,7 +2321,14 @@ MYSQLND_METHOD(mysqlnd_conn_data, 
set_client_option)(MYSQLND_CONN_DATA * const c
                        break;
                case MYSQL_SET_CHARSET_NAME:
                {
-                       char * new_charset_name = mnd_pestrdup(value, 
conn->persistent);
+                       char * new_charset_name;
+                       if (!mysqlnd_find_charset_name(value)) {
+                               SET_CLIENT_ERROR(*conn->error_info, 
CR_CANT_FIND_CHARSET, UNKNOWN_SQLSTATE, "Unknown character set");
+                               ret = FAIL;
+                               break;
+                       }
+                               
+                       new_charset_name = mnd_pestrdup(value, 
conn->persistent);
                        if (!new_charset_name) {
                                goto oom;
                        }


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to