Fix bugs reported by Coverity Scan
ClosedPublic

Authored by staniek on Mar 31 2016, 5:04 PM.

Details

Summary

https://scan.coverity.com/projects/kdb

Details:

Fix out-of-bounds read for defaultSQLTypeName(KDbField::LastType+1)

(CID 66289)

Remove structurally dead code

(coverity)

Add missing member initializations

(coverity)

GIT_SILENT Simplify code

Unused member

KDbTableViewColumn: Replace init() with ctor

SQLite dump: Fix sqlite3_snprintf usage and remove one memory leak

(this is fixed in newer SQLite too)

(coverity)

SDC: don't return from constructor on failed conversion from string, otherwise members initialization won't be complete

(coverity)

Fix possible nullptr dereferences

(coverity)

Fix possible division by 0

(coverity)

GIT_SILENT Remove dead code

(coverity)

GIT_SILENT Remove dead code

(coverity)

GIT_SILENT Fix unchecked return value warnings

(coverity)

KDbRecordData: Fix extra sizeof expression

Details:
"(SIZEOF_MISMATCH)suspicious_pointer_arithmetic: Adding this->m_numCols * 8UL /* sizeof (QVariant *) */ to pointer this->m_data of type QVariant ** is suspicious because adding an integral value to this pointer automatically scales that value by the size, 8 bytes, of the pointed-to type, QVariant *. Most likely, the multiplication by sizeof (QVariant *) in this expression is extraneous and should be eliminated."

(CID 66136)

Test Plan

ctest

Diff Detail

Repository
R15 KDb
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
staniek updated this revision to Diff 3047.Mar 31 2016, 5:04 PM
staniek retitled this revision from to Fix bugs reported by Coverity Scan https://scan.coverity.com/projects/kdb.
staniek updated this object.
staniek edited the test plan for this revision. (Show Details)
staniek added reviewers: Kexi-Devel-list, piggz.
Restricted Application added a project: KDb. · View Herald TranscriptMar 31 2016, 5:04 PM
staniek retitled this revision from Fix bugs reported by Coverity Scan https://scan.coverity.com/projects/kdb to Fix bugs reported by Coverity Scan.Mar 31 2016, 5:05 PM
staniek updated this object.
This revision was automatically updated to reflect the committed changes.