[NTG-pdftex] [ pdftex-Bugs-444 ] buffer overflow with \pdfmatch

noreply at sarovar.org noreply at sarovar.org
Sun Dec 4 15:12:14 CET 2005


Bugs item #444, was opened at 2005-10-29 19:24
You can respond by visiting: 
http://sarovar.org/tracker/?func=detail&atid=493&aid=444&group_id=106

Category: None
>Group: v1.30.0
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Robert (schlcht)
>Assigned to: Martin Schröder (oneiros)
Summary: buffer overflow with \pdfmatch

Initial Comment:
% The new \pdfmatch primitive will run into a buffer
overflow with strings
% longer than 1023 characters:
%
% (I am using 1.30.3 with Thanh's patches from
pdftex.sarovar.org/src,
% compiled under cygwin.)


\def\x{1,2,3,4,5,6,7,8,9,0,}
\def\testlist{%
  ,\x\x\x\x\x \x\x\x\x\x \x\x\x\x\x \x\x\x\x\x
   \x\x\x\x\x \x\x\x\x\x \x\x\x\x\x \x\x\x\x\x
   \x\x\x\x\x \x\x\x\x\x \x00,}% 1024

\ifcase\pdfmatch{,1,}{\testlist}\relax \fi

% Also, if the pattern is too long:
%\ifcase\pdfmatch{\testlist}{1}\relax \fi

\bye,
Robert.

PS: Is there a simple way to escape all regex special
characters in a string?



----------------------------------------------------------------------

Comment By: Martin Schröder (oneiros)
Date: 2005-12-04 15:12

Message:
Logged In: YES 
user_id=421

This has been fixed in 1.30.5

----------------------------------------------------------------------

Comment By: Hartmut Henkel (hhenkel)
Date: 2005-10-29 21:08

Message:
Logged In: YES 
user_id=929

see patch to utils.c. This makes makecstring() memory grow
on demand. Also increase MAX_CSTRING_LEN in ptexmac.h to e.
g. 10000000.

----------------------------------------------------------------------

You can respond by visiting: 
http://sarovar.org/tracker/?func=detail&atid=493&aid=444&group_id=106


More information about the ntg-pdftex mailing list