diff options
author | Robert Loehning <robert.loehning@qt.io> | 2020-07-09 13:33:34 +0200 |
---|---|---|
committer | Robert Loehning <robert.loehning@qt.io> | 2020-07-10 22:55:28 +0200 |
commit | e80be8a43da78b9544f12fbac47e92c7f1f64366 (patch) | |
tree | 4fe63bc0c52c82dff8d1643bbe3dabf789362abd /src/gui/image/qxpmhandler.cpp | |
parent | 744e55b85a96b37a16cb1389718419120b5090db (diff) |
Fix buffer overflow
Fixes: oss-fuzz-23988
Pick-to: 5.15 5.12
Change-Id: I4efdbfc3c0a96917c0c8224642896088ade99f35
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/gui/image/qxpmhandler.cpp')
-rw-r--r-- | src/gui/image/qxpmhandler.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/image/qxpmhandler.cpp b/src/gui/image/qxpmhandler.cpp index 2a02cba824..4fe39da532 100644 --- a/src/gui/image/qxpmhandler.cpp +++ b/src/gui/image/qxpmhandler.cpp @@ -976,7 +976,7 @@ static bool read_xpm_body( } else { char b[16]; b[cpp] = '\0'; - for (x=0; x<w && d<end; x++) { + for (x=0; x<w && d+cpp<end; x++) { memcpy(b, (char *)d, cpp); *p++ = (uchar)colorMap[xpmHash(b)]; d += cpp; |