Open Bug 1116731 Opened 5 years ago

potential use of unitialized exception_type, exception_location in mozcrash.check_for_java_exception

Categories

(Testing :: Mozbase, defect)

x86_64
Linux
defect
Not set

Tracking

(Not tracked)

People

(Reporter: bc, Unassigned)

References

()

Details

http://dxr.mozilla.org/mozilla-central/source/testing/mozbase/mozcrash/mozcrash/mozcrash.py#336

            if len(logcat) >= i + 3:
                logre = re.compile(r".*\): \t?(.*)")
                m = logre.search(logcat[i+1])
                if m and m.group(1):
                    exception_type = m.group(1)
                m = logre.search(logcat[i+2])
                if m and m.group(1):
                    exception_location = m.group(1)
                if not quiet:
                    print "PROCESS-CRASH | java-exception | %s %s" % (exception_type, exception_location)
            else:
                print "Automation Error: Logcat is truncated!"

Though it may not be possible due to the actual logcat contents, the code does not guarantee that exception_type and exception_location are set before they are used in the print line.
You need to log in before you can comment on or make changes to this bug.