summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill King <bill.king@nokia.com>2009-05-21 01:44:19 (GMT)
committerBill King <bill.king@nokia.com>2009-05-21 01:44:19 (GMT)
commitd94ed47b7748826fc2b9fba774cce51a54c24880 (patch)
tree2ded5e16d11b8dd385a5767529b7c7b5cf2d51bf
parent56a8e78869325453010fb6c41a5e2b9e6f8f1c95 (diff)
downloadQt-d94ed47b7748826fc2b9fba774cce51a54c24880.zip
Qt-d94ed47b7748826fc2b9fba774cce51a54c24880.tar.gz
Qt-d94ed47b7748826fc2b9fba774cce51a54c24880.tar.bz2
Fixes conditional jump on uninitialised value
As found by valgrind. Also add error reporting that was missing. Reviewed-by: Justin McPherson
-rw-r--r--src/sql/drivers/oci/qsql_oci.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/sql/drivers/oci/qsql_oci.cpp b/src/sql/drivers/oci/qsql_oci.cpp
index d63c482..a7031b1 100644
--- a/src/sql/drivers/oci/qsql_oci.cpp
+++ b/src/sql/drivers/oci/qsql_oci.cpp
@@ -1789,7 +1789,7 @@ bool QOCIResult::prepare(const QString& query)
bool QOCIResult::exec()
{
int r = 0;
- ub2 stmtType;
+ ub2 stmtType=0;
ub4 iters;
ub4 mode;
QList<QByteArray> tmpStorage;
@@ -1803,6 +1803,16 @@ bool QOCIResult::exec()
OCI_ATTR_STMT_TYPE,
d->err);
+ if (r != OCI_SUCCESS && r != OCI_SUCCESS_WITH_INFO) {
+ qOraWarning("QOCIResult::exec: Unable to get statement type:", d->err);
+ setLastError(qMakeError(QCoreApplication::translate("QOCIResult",
+ "Unable to get statement type"), QSqlError::StatementError, d->err));
+#ifdef QOCI_DEBUG
+ qDebug() << "lastQuery()" << lastQuery();
+#endif
+ return false;
+ }
+
if (stmtType == OCI_STMT_SELECT) {
iters = 0;
mode = OCI_DEFAULT;