Blame SOURCES/poppler-0.22.5-CVE-2013-4473.patch

9e9667
From b8682d868ddf7f741e93b791588af0932893f95c Mon Sep 17 00:00:00 2001
9e9667
From: Pino Toscano <pino@kde.org>
9e9667
Date: Mon, 16 Sep 2013 17:46:55 +0000
9e9667
Subject: pdfseparate: improve the path building
9e9667
9e9667
Make use of snprintf to limit the output to the pathName buffer;
9e9667
while I'm there, expand its size to 4096 (might help longer paths),
9e9667
although a better fix would be dynamically allocate its length
9e9667
(and/or using GooString, maybe).
9e9667
---
9e9667
(limited to 'utils/pdfseparate.cc')
9e9667
9e9667
diff --git a/utils/pdfseparate.cc b/utils/pdfseparate.cc
9e9667
index 35ae020..e41e547 100644
9e9667
--- a/utils/pdfseparate.cc
9e9667
+++ b/utils/pdfseparate.cc
9e9667
@@ -44,7 +44,7 @@ static const ArgDesc argDesc[] = {
9e9667
 };
9e9667
 
9e9667
 bool extractPages (const char *srcFileName, const char *destFileName) {
9e9667
-  char pathName[1024];
9e9667
+  char pathName[4096];
9e9667
   GooString *gfileName = new GooString (srcFileName);
9e9667
   PDFDoc *doc = new PDFDoc (gfileName, NULL, NULL, NULL);
9e9667
 
9e9667
@@ -66,7 +66,7 @@ bool extractPages (const char *srcFileName, const char *destFileName) {
9e9667
     return false;
9e9667
   }
9e9667
   for (int pageNo = firstPage; pageNo <= lastPage; pageNo++) {
9e9667
-    sprintf (pathName, destFileName, pageNo);
9e9667
+    snprintf (pathName, sizeof (pathName) - 1, destFileName, pageNo);
9e9667
     GooString *gpageName = new GooString (pathName);
9e9667
     int errCode = doc->savePageAs(gpageName, pageNo);
9e9667
     if ( errCode != errNone) {
9e9667
--
9e9667
cgit v0.9.0.2-2-gbebe