Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1630845

Summary: Coverity/cppcheck scan reports issues
Product: [Fedora] Fedora Reporter: Milan Crha <mcrha>
Component: highlightAssignee: Filipe Rosset <rosset.filipe>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 28CC: jochen, kevin, lxtnow, mcrha, rosset.filipe
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: highlight-3.47-1.fc27 highlight-3.47-1.fc29 highlight-3.47-1.fc28 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-11-14 02:55:27 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
scan-results.html
none
scan-results for 3.44-1 none

Description Milan Crha 2018-09-19 12:19:03 UTC
Created attachment 1484671 [details]
scan-results.html

Please find attaches a Coverity Scan report of highlight 3.42. It contains some valid issues, including the one about DEADCODE, which is, from my point of view, a copy&paste error, because the line
   3459|   	if (nextText == string::npos)
should rather read:
   3459|   	if (nextText2 == string::npos)
because of:
   3458|   	size_t nextText2 = line.find_first_not_of(" \t", nextText + 1);

Another would be the MISSING_BREAK issue, which you can mute with a comment like this:
   /* Falls through */

These are only two examples, but there are surely more valid issues.

I can try to help with it, if you wish, but I'm afraid I cannot test the changes properly, thus I created this bug report.

Comment 1 Filipe Rosset 2018-09-19 14:44:48 UTC
Hi Milan, highlight 3.44 is available at this moment. Can you please run this test against 3.44 and report this bug upstream? Thanks.

http://www.andre-simon.de/doku/highlight/en/changelog.php

Comment 2 Milan Crha 2018-09-20 11:42:50 UTC
I'm not sure what the upstream is. `rpm -qi highlight` says:
   Bug URL     : https://bugz.fedoraproject.org/highlight
which basically lists bugs filled here.

I'll re-run the test with newer version, I should do it immediately, I'm sorry I didn't.

Comment 3 Milan Crha 2018-09-20 17:13:51 UTC
Created attachment 1485237 [details]
scan-results for 3.44-1

There are less defects reported in the recent version. See the attached log, please.

Comment 4 Filipe Rosset 2018-09-20 18:10:24 UTC
Upstream bug report: https://gitlab.com/saalen/highlight/issues/82

Comment 5 Milan Crha 2018-09-20 20:15:12 UTC
(In reply to Filipe Rosset from comment #4)
> Upstream bug report: https://gitlab.com/saalen/highlight/issues/82

Ah, thanks for upstreaming this. Feel free to close this and get any fixes once they are officially released.

My offer to help with the fix still applies, just let me know if you'd like me to provide any patch (I want to avoid work duplication, in case anybody else would like to work on this).

Comment 6 Filipe Rosset 2018-09-20 20:33:15 UTC
(In reply to Milan Crha from comment #5)
> (In reply to Filipe Rosset from comment #4)
> > Upstream bug report: https://gitlab.com/saalen/highlight/issues/82
> 
> Ah, thanks for upstreaming this. Feel free to close this and get any fixes
> once they are officially released.
> 
> My offer to help with the fix still applies, just let me know if you'd like
> me to provide any patch (I want to avoid work duplication, in case anybody
> else would like to work on this).

great, the best option is to send patches upstream

Comment 7 Fedora Update System 2018-10-27 03:34:46 UTC
highlight-3.47-1.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-6435f89651

Comment 8 Fedora Update System 2018-10-27 03:35:00 UTC
highlight-3.47-1.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-845c2b9bc6

Comment 9 Fedora Update System 2018-10-27 03:35:13 UTC
highlight-3.47-1.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-210c4be57e

Comment 10 Fedora Update System 2018-10-27 15:35:27 UTC
highlight-3.47-1.fc28 has been pushed to the Fedora 28 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-2018-210c4be57e

Comment 11 Fedora Update System 2018-10-27 17:49:17 UTC
highlight-3.47-1.fc27 has been pushed to the Fedora 27 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-2018-845c2b9bc6

Comment 12 Fedora Update System 2018-10-31 18:49:53 UTC
highlight-3.47-1.fc29 has been pushed to the Fedora 29 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-2018-6435f89651

Comment 13 Fedora Update System 2018-11-14 02:55:27 UTC
highlight-3.47-1.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2018-11-14 03:11:57 UTC
highlight-3.47-1.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.

Comment 15 Fedora Update System 2018-11-14 03:23:31 UTC
highlight-3.47-1.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.