From 96d45a1878c471afd2ba5ff8d75c85d04840bad1 Mon Sep 17 00:00:00 2001 From: Nikita Ogorodnikov Date: Wed, 27 Dec 2023 17:31:20 +0100 Subject: [PATCH] Add telemetry point for null file content --- .../android/ndk/internal/DatadogNdkCrashHandler.kt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/dd-sdk-android-core/src/main/kotlin/com/datadog/android/ndk/internal/DatadogNdkCrashHandler.kt b/dd-sdk-android-core/src/main/kotlin/com/datadog/android/ndk/internal/DatadogNdkCrashHandler.kt index a70c73e3db..8bfcfedea0 100644 --- a/dd-sdk-android-core/src/main/kotlin/com/datadog/android/ndk/internal/DatadogNdkCrashHandler.kt +++ b/dd-sdk-android-core/src/main/kotlin/com/datadog/android/ndk/internal/DatadogNdkCrashHandler.kt @@ -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(",")}" + } + ) + } + } } }