summaryrefslogtreecommitdiffstats
path: root/src/sql/drivers/mysql/qsql_mysql.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-09-14 16:14:16 +0200
committerMarc Mutz <marc.mutz@kdab.com>2016-09-15 10:10:28 +0000
commita54d44298f6d2ecc1ec4d8c5c42c89c8a06fc5dd (patch)
tree3eac6336bdb8c8f86c9cd33098ae09bc46c9541d /src/sql/drivers/mysql/qsql_mysql.cpp
parent7529c39ba350c3fe9a2b4a96d3300481e3ea419f (diff)
QLatin1String: Fix UB (nullptr passed) in relational operators
Found by UBSan: qstring.h:1160:44: runtime error: null pointer passed as argument 1, which is declared to never be null qstring.h:1160:44: runtime error: null pointer passed as argument 2, which is declared to never be null Fix by avoiding the memcmp() calls if there's a chance that they might be called with nullptr. While at it, also implement !=, >, <=, >= in terms of ==, <, and add a test, because this particular UB was not fingered by any of the QtCore test cases, but by a Qt3D one. Change-Id: I413792dcc8431ef14f0c79f26e89a3e9fab69465 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/sql/drivers/mysql/qsql_mysql.cpp')
0 files changed, 0 insertions, 0 deletions