diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2016-10-20 23:33:02 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-11-16 19:49:04 +0000 |
commit | 8d8991c697d001e3e205ad03533dc0e5ca5dde0b (patch) | |
tree | 47b8a13f5af42915d3cf88ebbed46dda1554edac /src/widgets/accessible | |
parent | e655426e7ac8396713272e123fe0218380e13de1 (diff) |
QXbmHandler: don't construct a QByteArray just to find '0x' in text
Even QByteArray::fromRawData() allocates memory.
Instead of QByteArray::contains() and indexOf(), use good ol'
strstr(), like already done elsewhere in the same function.
Apart from the memory allocations saved, this fixes a Coverity error
complaining that indexOf() can return -1. It's a false positive on the
first occurrence, because we didn't call that function unless we know
there is a "0x" in the string, but the second _was_ wrong, because we
applied it on a new buffer, with unknown content.
Coverity-Id: 11262
Change-Id: I18f352c5576e24f89a5c3ef7f2f1b2176f2a235d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/widgets/accessible')
0 files changed, 0 insertions, 0 deletions