Bug 1458244

Summary: [PATCH] - improve perl-Term-Completion handling of spaces
Product: [Fedora] Fedora Reporter: Tomáš Kašpárek <tkasparek>
Component: perl-Term-CompletionAssignee: Jitka Plesnikova <jplesnik>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: jplesnik, perl-devel, ppisar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: perl-Term-Completion-1.00-12.fc27 perl-Term-Completion-1.00-11.fc26 perl-Term-Completion-1.00-9.fc24 perl-Term-Completion-1.00-10.fc25 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-06-26 19:12:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
patch which fixes the issue none

Description Tomáš Kašpárek 2017-06-02 11:38:56 UTC
Created attachment 1284412 [details]
patch which fixes the issue

Description of problem:
perl-Term-Completion does not handle spaces and tabs after the end of completed file very well.


Version-Release number of selected component (if applicable):
perl-Term-Completion-1.00-10.fc26


How reproducible:
always


Steps to Reproduce:
1. Enter file file?
2. /root[space][space][space][tab]
3. Ender file? /root   substr outside of string at /usr/share/perl5/vendor_perl/Term/Completion.pm line 207, <STDIN> line 1.
Use of uninitialized value $test in concatenation (.) or string at /usr/share/perl5/vendor_perl/Term/Completion.pm line 211, <STDIN> line 1.

Actual results:
Error message as shown in reproducer steps


Expected results:
No error

Additional info:
The error is caused when calculating the then length of substring to complete. In this case the length is negative, however it's accepted for completion as value of $add < 1 have boolean value of true. Accepting only positive values of $add fixes dais issue.

Comment 1 Petr Pisar 2017-06-05 11:37:10 UTC
I confirm the bug. I forwarded it to upstream.

Comment 2 Fedora Update System 2017-06-21 12:37:15 UTC
perl-Term-Completion-1.00-11.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-b48da4a737

Comment 3 Fedora Update System 2017-06-21 12:43:18 UTC
perl-Term-Completion-1.00-10.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-6f3ff717a9

Comment 4 Fedora Update System 2017-06-21 12:51:53 UTC
perl-Term-Completion-1.00-9.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2017-f6fbb679e7

Comment 5 Fedora Update System 2017-06-23 03:24:59 UTC
perl-Term-Completion-1.00-9.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-f6fbb679e7

Comment 6 Fedora Update System 2017-06-23 03:26:59 UTC
perl-Term-Completion-1.00-10.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-6f3ff717a9

Comment 7 Fedora Update System 2017-06-23 06:23:09 UTC
perl-Term-Completion-1.00-11.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-b48da4a737

Comment 8 Fedora Update System 2017-06-26 19:12:18 UTC
perl-Term-Completion-1.00-11.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2017-07-04 00:20:22 UTC
perl-Term-Completion-1.00-9.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2017-07-04 01:52:21 UTC
perl-Term-Completion-1.00-10.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.