[LLVMbugs] [Bug 17404] New: false positive when scanning

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Sep 29 10:44:17 PDT 2013


            Bug ID: 17404
           Summary: false positive when scanning
           Product: clang
           Version: unspecified
          Hardware: PC
               URL: http://devel.recluse.de/~bzed/scan-build/citadel/2013-
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: kremenek at apple.com
          Reporter: dothebart at citadel.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 11295
  --> http://llvm.org/bugs/attachment.cgi?id=11295&action=edit
Source file producing the false positive

This assumes a value to state being one of the both:
 789    else if (state == XDG_MIME_MAGIC_EOF || state == XDG_MIME_MAGIC_ERROR)
    (29) Taking true branch -> state needs to be XDG_MIME_MAGIC_ERROR
790    _xdg_mime_magic_match_free (match);

so in the next loop it will go here: 
793    state = _xdg_mime_magic_parse_error (magic_file);
which may return either XDG_MIME_MAGIC_EOF or XDG_MIME_MAGIC_SECTION; the later
is needed so the loop may continue.

 773    switch (state)
42    Control jumps to 'case XDG_MIME_MAGIC_MAGIC:' at line 781    

assumes XDG_MIME_MAGIC_MAGIC, which will never happen under this condition.

the file libcitadel /lib /xdgmime /xdgmimemagic.c is availabe here: 

or with the complete library and compile infrastructure here:

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130929/7b9f88b5/attachment.html>

More information about the llvm-bugs mailing list