diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2003-05-03 04:52:09 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-05-03 04:52:09 +0000 |
commit | 58f1856e573b4625770ae64ce5ffb8ff06dc461f (patch) | |
tree | 1b7b1aa0a9697afeb184a4634b13a28f661ea015 /sv.c | |
parent | 2347ae6c7f592dfae9dd8c4fdd43c29a77207bf3 (diff) | |
download | perl-58f1856e573b4625770ae64ce5ffb8ff06dc461f.tar.gz |
Tru64: PerlIO_tell() was returning about one _megabyte_ for
the fp offset, which was quite a big larger than the input file,
which meant that the SvGROW tried to grow the file to about
2**64-2**20, which made safesysrealloc() to understandably
croak (in argv.t).
p4raw-id: //depot/perl@19390
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -6354,7 +6354,7 @@ Perl_sv_gets(pTHX_ register SV *sv, register PerlIO *fp, I32 append) Stat_t st; if (!PerlLIO_fstat(PerlIO_fileno(fp), &st) && S_ISREG(st.st_mode)) { Off_t offset = PerlIO_tell(fp); - if (offset != (Off_t) -1) { + if (offset != (Off_t) -1 && st.st_size + append > offset) { (void) SvGROW(sv, (STRLEN)((st.st_size - offset) + append + 1)); } } |