summaryrefslogtreecommitdiff
path: root/ext/pdo_dblib
diff options
context:
space:
mode:
authorMiRacLe.RPZ <miracle@rpz.name>2015-07-03 10:28:06 +0300
committerAnatol Belski <ab@php.net>2015-10-18 11:10:34 +0200
commitacb2368976687d68381ae391ac3d917ae8fc2dd0 (patch)
tree6b928f80875dc95942b1c3c9a1893e7d166f0f01 /ext/pdo_dblib
parent22cbf68344a69fed5ad383f39f11617098561694 (diff)
downloadphp-git-acb2368976687d68381ae391ac3d917ae8fc2dd0.tar.gz
Segmentation fault on pdo_dblib::nextRowset (bug #69757)
Diffstat (limited to 'ext/pdo_dblib')
-rw-r--r--ext/pdo_dblib/dblib_stmt.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/ext/pdo_dblib/dblib_stmt.c b/ext/pdo_dblib/dblib_stmt.c
index 263ae6dcb8..9f47f0f7ed 100644
--- a/ext/pdo_dblib/dblib_stmt.c
+++ b/ext/pdo_dblib/dblib_stmt.c
@@ -203,8 +203,15 @@ static int pdo_dblib_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
}
struct pdo_column_data *col = &stmt->columns[colno];
-
- col->name = (char*)dbcolname(H->link, colno+1);
+
+ char *fname = (char*)dbcolname(H->link, colno+1);
+ char computed_buf[16];
+ if (*fname) {
+ col->name = estrdup(fname);
+ } else {
+ snprintf(computed_buf,16,"computed%d", colno);
+ col->name = estrdup(computed_buf);
+ }
col->maxlen = dbcollen(H->link, colno+1);
col->namelen = strlen(col->name);
col->param_type = PDO_PARAM_STR;