[poppler] fofi/FoFiType1.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Feb 25 23:27:01 UTC 2021


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

New commits:
commit 31734dcb365e2b69d88c86ddaee3bd62af97fade
Author: Albert Astals Cid <aacid at kde.org>
Date:   Fri Feb 26 00:19:58 2021 +0100

    strtok -> strtok_r
    
    Otherwise we have threading issues if two threads are doing strtok at
    the same time
    
    Fixes issue #1050

diff --git a/fofi/FoFiType1.cc b/fofi/FoFiType1.cc
index 5a6b11b4..25d38452 100644
--- a/fofi/FoFiType1.cc
+++ b/fofi/FoFiType1.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) 2005, 2008, 2010, 2018 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2005, 2008, 2010, 2018, 2021 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2005 Kristian Høgsberg <krh at redhat.com>
 // Copyright (C) 2010 Jakub Wilk <jwilk at jwilk.net>
 // Copyright (C) 2014 Carlos Garcia Campos <carlosgc at gnome.org>
@@ -335,7 +335,7 @@ void FoFiType1::parse()
                 if ((p2 = strchr(p, ']'))) {
                     *p2 = '\0';
                     for (j = 0; j < 6; ++j) {
-                        if ((p = strtok(j == 0 ? p : nullptr, " \t\n\r"))) {
+                        if ((p = strtok_r(j == 0 ? p : nullptr, " \t\n\r", &tokptr))) {
                             fontMatrix[j] = atof(p);
                         } else {
                             break;


More information about the poppler mailing list