deri pushed a commit to branch master
in repository groff.

commit b25f02d7a779b3885101848cea7000aff2f5ab3f
Author: Deri James <[email protected]>
AuthorDate: Fri Oct 11 23:00:10 2024 +0100

    Don't use inbuilt pdf parser on user supplied data.
    
    * src/devices/gropdf/gropdf.pl: Another example of using it
    in an inappropriate situation.
---
 ChangeLog                    |  7 +++++++
 src/devices/gropdf/gropdf.pl | 11 +++--------
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 18117793f..2a19840d7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-10-11  Deri James  <[email protected]>
+
+       Don't use inbuilt pdf parser on user supplied data.
+
+       * src/devices/gropdf/gropdf.pl: Another example of using it
+       in an inappropriate situation.
+
 2024-10-10  G. Branden Robinson <[email protected]>
 
        * tmac/doc.tmac (doc-enclose-string): Add warning.  mdoc input
diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl
index d83f8e17b..a6f7b6fee 100644
--- a/src/devices/gropdf/gropdf.pl
+++ b/src/devices/gropdf/gropdf.pl
@@ -1460,15 +1460,10 @@ sub do_x
                $pdfmark=~s(\\\[u00(..)\])(chr(hex($1)))eg;
                $pdfmark=~s/\\n/\n/g;
 
-               if ($pdfmark=~m/(.+) \/DOCINFO\s*$/s)
+               if ($pdfmark=~m/\/(\w+) \((.+)\) \/DOCINFO\s*$/s)
                {
-                   my @xwds=split(/ /,"<< $1 >>");
-                   my $docinfo=ParsePDFValue(\@xwds);
-
-                   foreach my $k (sort keys %{$docinfo})
-                   {
-                       $info{$k}='('.utf16(substr($docinfo->{$k},1,-1)).')' if 
$k ne 'Producer';
-                   }
+                   my $k=$1;
+                   $info{$k}='('.utf16($2,1,-1).')' if $k ne 'Producer';
                }
                elsif ($pdfmark=~m/(.+) \/DOCVIEW\s*$/)
                {

_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to