Bug 1450030

Summary: Unhandled errors, dereferencing NULL pointer
Product: [Community] LVM and device-mapper Reporter: Marian Csontos <mcsontos>
Component: lvm2Assignee: David Teigland <teigland>
lvm2 sub component: Compilation, building and portability QA Contact: cluster-qe <cluster-qe>
Status: NEW --- Docs Contact:
Severity: unspecified    
Priority: medium CC: agk, heinzm, jbrassow, msnitzer, prajnoha, teigland, zkabelac
Version: 2.02.171Keywords: Triaged
Target Milestone: ---Flags: rule-engine: lvm-technical-solution?
rule-engine: lvm-test-coverage?
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
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:

Description Marian Csontos 2017-05-11 12:16:15 UTC
Coverity reports few new errors in tools/command.c:

1. add_oo_definition_line and append_oo_definition_line return void on errors. It is possible lvm build would end up with incomplete option parsing.

2. add_oo_definition_line is dereferencing potentially NULL pointer oo->name.

Yes, there is virtual memory, OOM killer, and the generator would most likely segfault under that conditions anyway...

Comment 1 David Teigland 2017-05-11 15:35:20 UTC
Thanks, there is also other validation that should be done when parsing the command defs, which wasn't necessary when the cmd defs were generated at build time rather than at run time.  Also needed are checks that options are specified with the correct value types, and at the end checks for duplicate or equivalent command defs.