]> granicus.if.org Git - php/commitdiff
Patch to stop the crashing behavior exhibited by PHP/ODBC in SOLID/DB2
authorDan Kalowsky <kalowsky@php.net>
Wed, 5 Sep 2001 16:19:48 +0000 (16:19 +0000)
committerDan Kalowsky <kalowsky@php.net>
Wed, 5 Sep 2001 16:19:48 +0000 (16:19 +0000)
submitted by Walter Franzini (walter@sys-net.it)
@Fix for LONG_VARCHAR type crashing submitted by Walter Franzini (walter@sys-net.it)
#Should this also be put into the 4.0.7 RC cycle?

ext/odbc/php_odbc.c

index 4fdde9db5f7cd41120648f89bb92de4489cb0e75..274574b8a73e228966f80c4828957488b1b50168 100644 (file)
@@ -615,6 +615,8 @@ int odbc_bindcols(odbc_result *result TSRMLS_DC)
                        default:
                                rc = SQLColAttributes(result->stmt, (UWORD)(i+1), SQL_COLUMN_DISPLAY_SIZE,
                                                                        NULL, 0, NULL, &displaysize);
+                               displaysize = displaysize <= result->longreadlen ? displaysize : 
+                                                               result->longreadlen;
                                result->values[i].value = (char *)emalloc(displaysize + 1);
                                rc = SQLBindCol(result->stmt, (UWORD)(i+1), SQL_C_CHAR, result->values[i].value,
                                                        displaysize + 1, &result->values[i].vallen);