potential use of unitialized exception_type, exception_location in mozcrash.check_for_java_exception

NEW
Unassigned

Status

4 years ago
4 years ago

People

(Reporter: bc, Unassigned)

Tracking

Trunk
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

4 years ago
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.