From e80be8a43da78b9544f12fbac47e92c7f1f64366 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Thu, 9 Jul 2020 13:33:34 +0200 Subject: [PATCH] Fix buffer overflow Fixes: oss-fuzz-23988 Pick-to: 5.15 5.12 Change-Id: I4efdbfc3c0a96917c0c8224642896088ade99f35 Reviewed-by: Volker Hilsheimer --- src/gui/image/qxpmhandler.cpp | 2 +- .../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 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