summaryrefslogtreecommitdiff
path: root/ext/odbc/php_odbc.c
diff options
context:
space:
mode:
authorDan Kalowsky <kalowsky@php.net>2001-09-05 16:19:48 +0000
committerDan Kalowsky <kalowsky@php.net>2001-09-05 16:19:48 +0000
commit24b54b866fc36fed094c1f455e0174c99c24ee40 (patch)
tree161c0b0b3df5685ca49d113e6ae4accc755ab6e6 /ext/odbc/php_odbc.c
parentdbc9a93fba2f591cf317cd9dd7afff79e1b41f4f (diff)
downloadphp-git-24b54b866fc36fed094c1f455e0174c99c24ee40.tar.gz
Patch to stop the crashing behavior exhibited by PHP/ODBC in SOLID/DB2
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?
Diffstat (limited to 'ext/odbc/php_odbc.c')
-rw-r--r--ext/odbc/php_odbc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index 4fdde9db5f..274574b8a7 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -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);