summaryrefslogtreecommitdiffstats
path: root/redhat/applications/koffice/kexi-fix-possible-crash-in-buffered-mode-sqlite-2.patch
blob: 0be9764e35a0022fa34de611e8a2bc9cfc33f968 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--- kexi/kexidb/drivers/sqlite/sqlitecursor.cpp	2006/10/26 19:25:03	599352
+++ kexi/kexidb/drivers/sqlite/sqlitecursor.cpp	2007/10/01 19:29:39	719720
@@ -324,19 +324,21 @@
 	}
 	
 	//debug
-/*
-	if (m_result == FetchOK && d->curr_coldata) {
+/*	if (((int)m_result == (int)FetchOK) && d->curr_coldata) {
 		for (uint i=0;i<m_fieldCount;i++) {
 			KexiDBDrvDbg<<"col."<< i<<": "<< d->curr_colname[i]<<" "<< d->curr_colname[m_fieldCount+i]
 			<< " = " << (d->curr_coldata[i] ? TQString::fromLocal8Bit(d->curr_coldata[i]) : "(NULL)") <<endl;
 		}
-//		KexiDBDrvDbg << "SQLiteCursor::drv_getNextRecord(): "<<m_fieldCount<<" col(s) fetched"<<endl;
+		KexiDBDrvDbg << "SQLiteCursor::drv_getNextRecord(): "<<m_fieldCount<<" col(s) fetched"<<endl;
 	}*/
 }
 
 void SQLiteCursor::drv_appendCurrentRecordToBuffer()
 {
 //	KexiDBDrvDbg << "SQLiteCursor::drv_appendCurrentRecordToBuffer():" <<endl;
+	if (!d->curr_coldata)
+			return;
+
 	if (!d->cols_pointers_mem_size)
 		d->cols_pointers_mem_size = m_fieldCount * sizeof(char*);
 	const char **record = (const char**)malloc(d->cols_pointers_mem_size);