We use NULL to mean "unknown source", but you can't pass NULL to C string functions.
Found by the stability monkeys.
Bug: 5880980
Change-Id: I2775024a5038d3716f4e7c6beac02c3f5e0a3f3a
diff --git a/src/monitor.cc b/src/monitor.cc
index caaa116..b641160 100644
--- a/src/monitor.cc
+++ b/src/monitor.cc
@@ -800,12 +800,15 @@
const char*& source_file, uint32_t& line_number) const {
// If method is null, location is unknown
if (method == NULL) {
- source_file = "unknown";
+ source_file = "";
line_number = 0;
return;
}
MethodHelper mh(method);
source_file = mh.GetDeclaringClassSourceFile();
+ if (source_file == NULL) {
+ source_file = "";
+ }
line_number = mh.GetLineNumFromNativePC(pc);
}