From: Wez Furlong Date: Tue, 19 Jul 2005 03:39:49 +0000 (+0000) Subject: Limit the size of columns to 64K, so we don't try to allocate 2GB for each text X-Git-Tag: RELEASE_0_9~78 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e568ea3277c487281a6d911b499724015cd41747;p=php Limit the size of columns to 64K, so we don't try to allocate 2GB for each text column coming out of informix. Refs Bug #33533. Not totally closed yet; still need to cater for text fields longer than 64k in a sane manner. --- diff --git a/ext/pdo_odbc/odbc_stmt.c b/ext/pdo_odbc/odbc_stmt.c index 0c6f77f459..00f88f16d2 100755 --- a/ext/pdo_odbc/odbc_stmt.c +++ b/ext/pdo_odbc/odbc_stmt.c @@ -386,6 +386,12 @@ static int odbc_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) return 0; } + /* enforce a practical limitation. + * TODO: make this work more nicely */ + if (colsize > 65535) { + colsize = 65535; + } + col->maxlen = S->cols[colno].datalen = colsize; col->namelen = colnamelen; col->name = estrdup(S->cols[colno].colname);