Bug 2111538

Summary: Use of uninitialized value when running jhead
Product: [Fedora] Fedora EPEL Reporter: Ling Jiang <tricker51449>
Component: jheadAssignee: Adrian Reber <adrian>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: epel7CC: adrian
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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
crash inputs none

Description Ling Jiang 2022-07-27 13:13:40 UTC
Created attachment 1899660 [details]
crash inputs

Description of problem:
use-of-uninitialized-value when running jhead with MemorySanitizer.


Version-Release number of selected component (if applicable):
The latest version in https://github.com/Matthias-Wandel/jhead
commit id: 0e98605d0a08bc692b87ca878bb4dc7bdfc12471

How reproducible:
Stable reproduce in the recent versions


Steps to Reproduce:
1. Run jhead with the attached inputs (28 files in total and test with `jhead 0`)

Actual results:
Nonfatal Error : '0' Extraneous 127 padding bytes before section CF
Uninitialized bytes in MemcmpInterceptorCommon at offset 0 inside [0x702000000002, 4)
==50456==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x55b1b9248ede in memcmp (/workspace/jhead/jhead+0x57ede) (BuildId: d722f88b0627b52aea0538b22b185e2befd623fc)
    #1 0x55b1b92ac84d in ReadJpegSections (/workspace/jhead/jhead+0xbb84d) (BuildId: d722f88b0627b52aea0538b22b185e2befd623fc)
    #2 0x55b1b92ae662 in ReadJpegFile (/workspace/jhead/jhead+0xbd662) (BuildId: d722f88b0627b52aea0538b22b185e2befd623fc)
    #3 0x55b1b929e016 in ProcessFile jhead.c
    #4 0x55b1b929c7b7 in main (/workspace/jhead/jhead+0xab7b7) (BuildId: d722f88b0627b52aea0538b22b185e2befd623fc)
    #5 0x7f2cb8de4d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f) (BuildId: 89c3cb85f9e55046776471fed05ec441581d1969)
    #6 0x7f2cb8de4e3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f) (BuildId: 89c3cb85f9e55046776471fed05ec441581d1969)
    #7 0x55b1b92103b4 in _start (/workspace/jhead/jhead+0x1f3b4) (BuildId: d722f88b0627b52aea0538b22b185e2befd623fc)

SUMMARY: MemorySanitizer: use-of-uninitialized-value (/workspace/jhead/jhead+0x57ede) (BuildId: d722f88b0627b52aea0538b22b185e2befd623fc) in memcmp
Exiting

Expected results:
Not applicable

Additional info:
All the files have diverse execution paths but the same error