1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
From: Tom Callaway <spot@fedoraproject.org>
Date: Nov 18 2020 20:29:02 +0000
Subject: fix uninitialized variable issue (bz1283764)
Origin: https://src.fedoraproject.org/rpms/perl-File-Tail/c/5892b1b7d2784a81debeb7cdf10e7b062533020e
Bug: https://rt.cpan.org/Ticket/Display.html?id=109163
Bug-Debian: https://bugs.debian.org/1104900
Bug-Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1283764
Last-Update: 2025-05-09
--- a/Tail.pm.debug
+++ b/Tail.pm.debug
@@ -382,6 +382,9 @@ sub reset_pointers {
if (defined($oldhandle)) {
# If file has not been changed since last OK read do not do anything
$st=stat($newhandle);
+ # inode 0 should never happen, so this should be safe to init to.
+ $object->{'inode'}=0 unless defined($object->{'inode'});
+ $object->{'curpos'}=0 unless defined($object->{'curpos'});
# lastread uses fractional time, stat doesn't. This can cause false
# negatives.
# If the file was changed the same second as it was last read,
--- a/Tail.pm
+++ b/Tail.pm
@@ -378,6 +378,9 @@ sub reset_pointers {
if (defined($oldhandle)) {
# If file has not been changed since last OK read do not do anything
$st=stat($newhandle);
+ # inode 0 should never happen, so this should be safe to init to.
+ $object->{'inode'}=0 unless defined($object->{'inode'});
+ $object->{'curpos'}=0 unless defined($object->{'curpos'});
# lastread uses fractional time, stat doesn't. This can cause false
# negatives.
# If the file was changed the same second as it was last read,
|