diff options
| author | George Schlossnagle <gschlossnagle@php.net> | 2005-09-01 14:44:11 +0000 |
|---|---|---|
| committer | George Schlossnagle <gschlossnagle@php.net> | 2005-09-01 14:44:11 +0000 |
| commit | 248c30dad75d8ab3700eade2f9e18ff408faba26 (patch) | |
| tree | 5d160f1560733cd0bbe1fa3c2fa175bcb4e2079e | |
| parent | 1978e9109f4412997c91bf6962f0a89ec8c11bf6 (diff) | |
| download | php-git-248c30dad75d8ab3700eade2f9e18ff408faba26.tar.gz | |
MFH. Protect against underflow - refs http://pecl.php.net/bugs/bug.php?id=5193
| -rwxr-xr-x | ext/pdo/pdo_stmt.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index b988598e66..1dd5c79a0f 100755 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -1541,7 +1541,10 @@ static PHP_METHOD(PDOStatement, getColumnMeta) if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &colno)) { RETURN_FALSE; } - + if(colno < 0) { + pdo_raise_impl_error(stmt->dbh, stmt, "42P10", "column number must be non-negative" TSRMLS_CC); + RETURN_FALSE; + } if (!stmt->methods->get_column_meta) { pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "driver doesn't support meta data" TSRMLS_CC); RETURN_FALSE; |
