Post without Account — your post will be reviewed, and if appropriate, posted under Anonymous.

RT 118717 - Unguarded I/O in saveas

  • 2 Replies
  • 714 Views
*

Offline Phil

  • Global Moderator
  • Sr. Member
  • *****
  • 356
    • View Profile
RT 118717 - Unguarded I/O in saveas
« November 11, 2016, 02:39:22 PM »
Fri Nov 11 09:19:39 2016 jv [...] cpan.org - Ticket created
Subject:    Unguarded open in saveas

PDF/API2.pm, line 949, routine saveas, the open, print and close are not checked for errors. This may lead to mysterious messages and loss of data.

A user of mine encountered this on Windows, where the program issued (for him) ununderstandable messages like:

binmode() on closed filehandle OUTF
printf on closed filehandle OUTF

The culprit was another program that kept the pdf file open so it could not be rewritten.
#
Fri Nov 11 09:20:29 2016 jv [...] cpan.org - Subject changed from 'Unguarded open in saveas' to 'Unguarded I/O in saveas'
#
Fri Nov 11 09:20:29 2016 jv [...] cpan.org - Broken in 2.030 added
#
Fri Nov 11 09:20:29 2016 jv [...] cpan.org - Fixed in 2.030 deleted

*

Offline Phil

  • Global Moderator
  • Sr. Member
  • *****
  • 356
    • View Profile
Re: RT 118717 - Unguarded I/O in saveas
« Reply #1: January 27, 2017, 10:19:53 AM »
Thu Jan 26 13:18:15 2017 steve [...] deefs.net - Correspondence added

Thanks for the report.  I've added an "or die..." to the "open" call in open() and saveas(), which will give a more useful error.


On Fri Nov 11 09:19:39 2016, JV wrote:
Show quoted text
#
Thu Jan 26 13:18:16 2017 The RT System itself - Status changed from 'new' to 'open'
#
Thu Jan 26 13:18:26 2017 steve [...] deefs.net - Status changed from 'open' to 'patched'

*

Offline Phil

  • Global Moderator
  • Sr. Member
  • *****
  • 356
    • View Profile
Re: RT 118717 - Unguarded I/O in saveas
« Reply #2: January 31, 2017, 09:44:52 AM »
Mon Jan 30 11:48:24 2017 steve [...] deefs.net - Status changed from 'patched' to 'resolved'
#
Mon Jan 30 11:48:32 2017 steve [...] deefs.net - Fixed in 2.031 added