From b9c8405d134c40b1edf06b7b93eef14dca0936f4 Mon Sep 17 00:00:00 2001 From: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com> Date: Wed, 28 Aug 2024 14:13:07 +0200 Subject: [PATCH] fix(sourcebundles): Skip invalid sources (#861) --- CHANGELOG.md | 4 ++++ symbolic-debuginfo/src/sourcebundle.rs | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb4f7805..a59f15c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Unreleased + +- Skip invalid sources ([#861](https://github.com/getsentry/symbolic/pull/861)) + ## 12.10.0 **Features** diff --git a/symbolic-debuginfo/src/sourcebundle.rs b/symbolic-debuginfo/src/sourcebundle.rs index eec855ed..0e00774f 100644 --- a/symbolic-debuginfo/src/sourcebundle.rs +++ b/symbolic-debuginfo/src/sourcebundle.rs @@ -1314,7 +1314,12 @@ where info.set_ty(SourceFileType::Source); info.set_path(filename.clone()); - self.add_file(bundle_path, source, info)?; + if let Err(e) = self.add_file(bundle_path, source, info) { + // Skip sources that are not UTF-8 + if e.kind != SourceBundleErrorKind::ReadFailed { + return Err(e); + }; + } } }