[poppler] poppler/Function.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jan 9 23:51:50 UTC 2020


 poppler/Function.cc |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit ca9b9cb264b2d2372a171dd8779ac5527dad2b12
Author: Albert Astals Cid <aacid at kde.org>
Date:   Fri Jan 10 00:30:37 2020 +0100

    Fix crash on broken files
    
    TIL INT_MIN / -1 causes FPE
    
    Fixes issue #869

diff --git a/poppler/Function.cc b/poppler/Function.cc
index cbbaf1aa..8d6fab7a 100644
--- a/poppler/Function.cc
+++ b/poppler/Function.cc
@@ -13,7 +13,7 @@
 // All changes made under the Poppler project to this file are licensed
 // under GPL version 2 or later
 //
-// Copyright (C) 2006, 2008-2010, 2013-2015, 2017-2019 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2006, 2008-2010, 2013-2015, 2017-2020 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2006 Jeff Muizelaar <jeff at infidigm.net>
 // Copyright (C) 2010 Christian Feuersänger <cfeuersaenger at googlemail.com>
 // Copyright (C) 2011 Andrea Canciani <ranma42 at gmail.com>
@@ -1559,7 +1559,7 @@ void PostScriptFunction::exec(PSStack *stack, int codePtr) const {
       case psOpIdiv:
 	i2 = stack->popInt();
 	i1 = stack->popInt();
-	if (likely(i2 != 0)) {
+	if (likely((i2 != 0) && !(i2 == -1 && i1 == INT_MIN))) {
 	  stack->pushInt(i1 / i2);
 	}
 	break;


More information about the poppler mailing list