From b773a02318f71d0251885a7772a0026d8046ab4f Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 2 Jul 2018 23:32:28 -0700 Subject: [PATCH] ELF parser: fix off-by-one error I don't know why Arvid subtracted 1 when he wrote this code. But it was wrong. Fortunately, the section size was not used afterwards, but the next commit will. Change-Id: I117816bf0f5e469b8d34fffd153dc8383b00b94a Reviewed-by: Simon Hausmann --- src/corelib/plugin/qelfparser_p.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/plugin/qelfparser_p.cpp b/src/corelib/plugin/qelfparser_p.cpp index 62555b006d6..159a324c6bb 100644 --- a/src/corelib/plugin/qelfparser_p.cpp +++ b/src/corelib/plugin/qelfparser_p.cpp @@ -224,7 +224,7 @@ int QElfParser::parse(const char *dataStart, ulong fdlen, const QString &library return Corrupt; } *pos = sh.offset; - *sectionlen = sh.size - 1; + *sectionlen = sh.size; if (shnam[1] == 'q') return QtMetaDataSection; }