AppChecker created CLOUDSTACK-9920:
--------------------------------------

             Summary: Possible null pointer exception
                 Key: CLOUDSTACK-9920
                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9920
             Project: CloudStack
          Issue Type: Bug
      Security Level: Public (Anyone can view this level - this is the default.)
          Components: Hypervisor Controller, KVM
    Affects Versions: 4.5.2.2, 4.9.0.1
            Reporter: AppChecker


Hi.

Please look this [code 
fragment|https://github.com/apache/cloudstack/blob/87ef8137534fa798101f65c6691fcf71513ac978/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java#L242]:

{code}
if (brNameMatcher.group(1) != null || !brNameMatcher.group(1).isEmpty()) {
{code}

if brNameMatcher.group(1) is null, method isEmpty will be called, so  null 
pointer exception is happened,
Probably, is should be:
{code}
if (brNameMatcher.group(1) != null && !brNameMatcher.group(1).isEmpty()) {
{code}

Similar code:
https://github.com/apache/cloudstack/blob/87ef8137534fa798101f65c6691fcf71513ac978/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/IvsVifDriver.java#L214

This possible defect found by 
[AppChecker|https://npo-echelon.ru/en/solutions/appchecker.php]



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to