Bug 1319855

Summary: truncate -s 1T src/.libs/.libfipscheck.so.1.hmac ; ./src/fipscheck ./src/fipscheck
Product: [Fedora] Fedora Reporter: cagney
Component: fipscheckAssignee: Tomas Mraz <tmraz>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 25CC: tmraz
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: fipscheck-1.5.0-1.fc26 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-24 10:03:34 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:

Description cagney 2016-03-21 16:34:43 UTC
Description of problem:

fipscheck uses getline() to read its hmac files, fread() might be better


Version-Release number of selected component (if applicable):

default branch


How reproducible:

100%


Steps to Reproduce:
1. build fipscheck
2. truncate -s 1T src/.libs/.libfipscheck.so.1.hmac
3. ./src/fipscheck ./src/fipscheck


Actual results:

Machine goes into the weeds.  It did come back eventually so, perhaps I should try a bigger file?


Expected results:

Short sharp error.


Additional info:

The problem is with:

        if (getline(&hmac, &n, hf) > 0) {

I suspect fread() would be safer.

Comment 1 Jan Kurik 2016-07-26 05:09:06 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 25 development cycle.
Changing version to '25'.