OSDN Git Service

fix possible heap corruption in QXmlStream
authorIvailo Monev <xakepa10@gmail.com>
Sun, 27 Dec 2020 21:16:03 +0000 (21:16 +0000)
committerIvailo Monev <xakepa10@gmail.com>
Sun, 27 Dec 2020 21:16:03 +0000 (21:16 +0000)
upstream commit:
https://github.com/qt/qtbase/commit/6256729a6da532079505edfe4c56a6ef29cd8ab8

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/xml/kernel/qxmlstream.g
src/xml/kernel/qxmlstream_p.h

index 7d79c03..7239004 100644 (file)
@@ -738,7 +738,7 @@ bool QXmlStreamReaderPrivate::parse()
             state_stack[tos] = 0;
             return true;
         } else if (act > 0) {
-            if (++tos == stack_size-1)
+            if (++tos >= stack_size-1)
                 reallocateStack();
 
             Value &val = sym_stack[tos];
index 55ce3a3..773f3e9 100644 (file)
@@ -1220,7 +1220,7 @@ bool QXmlStreamReaderPrivate::parse()
             state_stack[tos] = 0;
             return true;
         } else if (act > 0) {
-            if (++tos == stack_size-1)
+            if (++tos >= stack_size-1)
                 reallocateStack();
 
             Value &val = sym_stack[tos];