Skip to content

Commit e568ea3

Browse files
committed
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.
1 parent 96a273a commit e568ea3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ext/pdo_odbc/odbc_stmt.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,12 @@ static int odbc_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
386386
return 0;
387387
}
388388

389+
/* enforce a practical limitation.
390+
* TODO: make this work more nicely */
391+
if (colsize > 65535) {
392+
colsize = 65535;
393+
}
394+
389395
col->maxlen = S->cols[colno].datalen = colsize;
390396
col->namelen = colnamelen;
391397
col->name = estrdup(S->cols[colno].colname);

0 commit comments

Comments
 (0)