[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


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

            Bug ID: 17404
           Summary: false positive when scanning
           Product: clang
           Version: unspecified
          Hardware: PC
               URL: http://devel.recluse.de/~bzed/scan-build/citadel/2013-
                    09-29-1/report-v4xZnV.html#Path38
                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: 
case XDG_MIME_MAGIC_ERROR:
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.

but: 
 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: 
http://code.citadel.org/?p=citadel.git;a=tree;f=libcitadel/lib/xdgmime;h=0c63b6ff7c9c1581fc6e2ae52c3f0b34d82a7149;hb=HEAD

or with the complete library and compile infrastructure here:
http://easyinstall.citadel.org/libcitadel-8.20.tar.gz

-- 
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