http://llvm.org/bugs/show_bug.cgi?id=8697

           Summary: Field access results in a dereference of a null
                    pointer (loaded from variable 'l')
           Product: clang
           Version: 2.8
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


Bug reported by the clang static analyzer.

Description: Field access results in a dereference of a null pointer (loaded
from variable 'l')
File: lvm2.git/lib/config/config.c
Line: 618

This case seems to be quite clear - allocated area for root node is in fact
memset() to 0 - but analyzer seems to think there is chance to have path 
!root->child not executed first - so gives false positive about possible null
dereference.

As an easy hack could be used   'root->child = NULL'  after root node is
allocated - but that's ugly.

Is there a way to instrument with same attribute that given array is zeroed?

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to