develooper Front page | perl.perl5.porters | Postings from September 2000

[ID 20000903.010] Possible internal array bound overflow causedby formats

From:
Carl Christian Eastlund
Date:
September 3, 2000 20:00
Subject:
[ID 20000903.010] Possible internal array bound overflow causedby formats
Message ID:
200009040259.e842xxO20600@unix7.andrew.cmu.edu

This is a bug report for perl from cce@andrew.cmu.edu,
generated with the help of perlbug 1.26 running under perl 5.00503.


-----------------------------------------------------------------
[Please enter your report here]

When dereferencing hash entries in a particular way on the argument line of a
format, Perl does very strange things during compiling.  On a Redhat 5.1
machine running Perl 5.005_03, it would generally find nonexistent text on a
blank line.  (The following error:)

-----
Semicolon seems to be missing at ./bad.pl line 9.
syntax error at ./bad.pl line 10, near "Title2"
Bareword found where operator expected at ./bad.pl line 15, near "*u"
  (Might be a runaway multi-line << string starting on line 13)
	(Missing operator before u?)
syntax error at ./bad.pl line 15, near "("
Unrecognized character \010 at ./bad.pl line 15.
-----

Note that above, the string "*u" was actually "au", with an upward accent (/)
above the a.  Also, the "(" was some unreproduceable string which
cut-and-paste under X mangled.  Slight variations on the code produced other
non-ASCII symbols.

On the machine detailed below (from which this report is sent), the same code
gave this error message:

-----
Semicolon seems to be missing at ./bad.pl line 9.
syntax error at ./bad.pl line 10, near "Title2"
Out of memory during ridiculously large request at ./bad.pl line 13.
-----

The code giving these errors follows:

-----
#!/usr/bin/perl

#use FileHandle;

open OUT, "> output.txt";

format Format =
Title1:           @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                  "$h{primary}"
Title2:           @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                  $h{irrelevant}




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About