From 5b2f75388424995925a0e45654a0d509b290aaa0 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Thu, 9 Jul 2020 13:33:34 +0200 Subject: Fix buffer overflow Fixes: oss-fuzz-23988 Change-Id: I4efdbfc3c0a96917c0c8224642896088ade99f35 Reviewed-by: Volker Hilsheimer (cherry picked from commit e80be8a43da78b9544f12fbac47e92c7f1f64366) Reviewed-by: Qt Cherry-pick Bot --- src/gui/image/qxpmhandler.cpp | 2 +- tests/auto/gui/image/qimagereader/images/oss-fuzz-23988.xpm | 1 + tests/auto/gui/image/qimagereader/tst_qimagereader.cpp | 8 ++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 tests/auto/gui/image/qimagereader/images/oss-fuzz-23988.xpm diff --git a/src/gui/image/qxpmhandler.cpp b/src/gui/image/qxpmhandler.cpp index 17272ffe69..417dab7ce3 100644 --- a/src/gui/image/qxpmhandler.cpp +++ b/src/gui/image/qxpmhandler.cpp @@ -973,7 +973,7 @@ static bool read_xpm_body( } else { char b[16]; b[cpp] = '\0'; - for (x=0; x