File CVE-2020-17507.patch of Package libqt4-sql-plugins
--- qt-everywhere-opensource-src-4.8.7/src/gui/image/qxbmhandler.cpp
+++ qt-everywhere-opensource-src-4.8.7/src/gui/image/qxbmhandler.cpp
@@ -154,7 +154,9 @@
w = (w+7)/8; // byte width
while (y < h) { // for all encoded bytes...
- if (p) { // p = "0x.."
+ if (p && p < (buf + readBytes - 3)) { // p = "0x.."
+ if (!isxdigit(p[2]) || !isxdigit(p[3]))
+ return false;
*b++ = hex2byte(p+2);
p += 2;
if (++x == w && ++y < h) {