Skip to content

Commit

Permalink
Add telemetry point for null file content
Browse files Browse the repository at this point in the history
  • Loading branch information
0xnm committed Dec 27, 2023
1 parent 9eefcc4 commit 96d45a1
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,19 @@ internal class DatadogNdkCrashHandler(
return if (content.isEmpty()) {
null
} else {
String(content)
String(content).also {
// temporary, to have more telemetry data
if (it.contains("\\u0000") || it.contains("\u0000")) {
internalLogger.log(
InternalLogger.Level.ERROR,
InternalLogger.Target.TELEMETRY,
{
"Decoded file (${file.name}) content contains NULL character, file content={$it}," +
" raw_bytes=${content.joinToString(",")}"
}
)
}
}
}
}

Expand Down

0 comments on commit 96d45a1

Please sign in to comment.