diff --git a/chrome/browser/extensions/api/feedback_private/chrome_feedback_private_delegate.cc b/chrome/browser/extensions/api/feedback_private/chrome_feedback_private_delegate.cc
index 4401a31d79319..a36f74793c39f 100644
--- a/chrome/browser/extensions/api/feedback_private/chrome_feedback_private_delegate.cc
+++ b/chrome/browser/extensions/api/feedback_private/chrome_feedback_private_delegate.cc
@@ -206,7 +206,7 @@ void ChromeFeedbackPrivateDelegate::FetchExtraLogs(
     // We can pass null for the 1st party IDs since we are just anonymizing
     // wifi data here.
     system_logs::SystemLogsFetcher* fetcher =
-        new system_logs::SystemLogsFetcher(scrub, nullptr);
+        new system_logs::SystemLogsFetcher(scrub, {});
     fetcher->AddSource(std::make_unique<system_logs::IwlwifiDumpLogSource>());
     fetcher->Fetch(base::BindOnce(&OnFetchedExtraLogs, feedback_data,
                                   std::move(callback)));
diff --git a/chrome/browser/feedback/system_logs/about_system_logs_fetcher.cc b/chrome/browser/feedback/system_logs/about_system_logs_fetcher.cc
index 1530633e671e9..3468f76293c81 100644
--- a/chrome/browser/feedback/system_logs/about_system_logs_fetcher.cc
+++ b/chrome/browser/feedback/system_logs/about_system_logs_fetcher.cc
@@ -47,7 +47,7 @@ namespace system_logs {
 SystemLogsFetcher* BuildAboutSystemLogsFetcher(content::WebUI* web_ui) {
   const bool scrub_data = false;
   // We aren't anonymizing, so we can pass null for the 1st party IDs.
-  SystemLogsFetcher* fetcher = new SystemLogsFetcher(scrub_data, nullptr);
+  SystemLogsFetcher* fetcher = new SystemLogsFetcher(scrub_data, {});
 
   fetcher->AddSource(std::make_unique<ChromeInternalLogSource>());
   fetcher->AddSource(std::make_unique<DeviceEventLogSource>());
diff --git a/components/feedback/redaction_tool/redaction_tool.cc b/components/feedback/redaction_tool/redaction_tool.cc
index b712fd149a64f..f4d78b82130de 100644
--- a/components/feedback/redaction_tool/redaction_tool.cc
+++ b/components/feedback/redaction_tool/redaction_tool.cc
@@ -2,10 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifdef UNSAFE_BUFFERS_BUILD
-// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
-#pragma allow_unsafe_buffers
-#endif
+
 
 #include "components/feedback/redaction_tool/redaction_tool.h"
 
@@ -584,12 +581,12 @@ bool IsFeatureEnabled(const base::Feature& feature) {
 }
 }  // namespace
 
-RedactionTool::RedactionTool(const char* const* first_party_extension_ids)
+RedactionTool::RedactionTool(base::span<const char *const>first_party_extension_ids)
     : RedactionTool(first_party_extension_ids,
                     RedactionToolMetricsRecorder::Create()) {}
 
 RedactionTool::RedactionTool(
-    const char* const* first_party_extension_ids,
+    base::span<const char* const> first_party_extension_ids,
     std::unique_ptr<RedactionToolMetricsRecorder> metrics_recorder)
     : first_party_extension_ids_(first_party_extension_ids),
       metrics_recorder_(std::move(metrics_recorder)) {
@@ -1060,8 +1057,8 @@ std::string RedactionTool::RedactIbans(
 
       chunk.append(numbers_only.substr(pos, next_chunk_size));
 
-      const unsigned long chunk_number =
-          std::strtoul(chunk.c_str(), nullptr, 10);
+      unsigned chunk_number = 0;
+      base::StringToUint(chunk, &chunk_number);
 
       remainder = chunk_number % 97;
       chunk = base::NumberToString(remainder);
@@ -1208,7 +1205,7 @@ std::string RedactionTool::RedactCustomPatternWithContext(
       prematch.append(pre_matched_id);
       scrubbed_match = MaybeScrubIPAddress(matched_id_as_string);
       if (scrubbed_match == matched_id_as_string ||
-          ((strcmp("IPv4", pattern.alias) == 0) &&
+          ((std::string_view(pattern.alias) == "IPv4") &&
            ShouldSkipIPv4Address(prematch))) {
         result.append(skipped);
         result.append(pre_matched_id);
@@ -1246,7 +1243,7 @@ std::string RedactionTool::RedactCustomPatternWithContext(
 // This takes a |url| argument and returns true if the URL is exempt from
 // redaction, returns false otherwise.
 bool IsUrlExempt(std::string_view url,
-                 const char* const* first_party_extension_ids) {
+                 base::span<const char *const>first_party_extension_ids) {
   // We do not exempt anything with a query parameter.
   if (url.find("?") != std::string_view::npos) {
     return false;
@@ -1273,7 +1270,7 @@ bool IsUrlExempt(std::string_view url,
     return false;
   }
 
-  if (!first_party_extension_ids) {
+  if (first_party_extension_ids.empty()) {
     return false;
   }
 
@@ -1287,15 +1284,12 @@ bool IsUrlExempt(std::string_view url,
     return false;
   }
 
-  int i = 0;
-  const char* test_id = first_party_extension_ids[i];
   const std::string_view url_sub =
       url.substr(sizeof("chrome-extension://") - 1);
-  while (test_id) {
+  for (const char* test_id : first_party_extension_ids) {
     if (url_sub.starts_with(test_id)) {
       return true;
     }
-    test_id = first_party_extension_ids[++i];
   }
   return false;
 }
@@ -1363,13 +1357,13 @@ std::string RedactionTool::RedactCustomPatternWithoutContext(
 
 RedactionToolContainer::RedactionToolContainer(
     scoped_refptr<base::SequencedTaskRunner> task_runner,
-    const char* const* first_party_extension_ids)
+    base::span<const char *const>first_party_extension_ids)
     : redactor_(new RedactionTool(first_party_extension_ids)),
       task_runner_(task_runner) {}
 
 RedactionToolContainer::RedactionToolContainer(
     scoped_refptr<base::SequencedTaskRunner> task_runner,
-    const char* const* first_party_extension_ids,
+    base::span<const char *const>first_party_extension_ids,
     std::unique_ptr<RedactionToolMetricsRecorder> metrics_recorder)
     : redactor_(new RedactionTool(first_party_extension_ids,
                                   std::move(metrics_recorder))),
diff --git a/components/feedback/redaction_tool/redaction_tool.h b/components/feedback/redaction_tool/redaction_tool.h
index 81f8b69e056ae..da605a4d3e711 100644
--- a/components/feedback/redaction_tool/redaction_tool.h
+++ b/components/feedback/redaction_tool/redaction_tool.h
@@ -10,6 +10,8 @@
 #include <set>
 #include <string>
 
+#include "base/containers/span.h"
+#include "base/memory/raw_span.h"
 #include "base/component_export.h"
 #include "base/feature_list.h"
 #include "base/location.h"
@@ -58,10 +60,10 @@ class RedactionTool {
   // |first_party_extension_ids| is a null terminated array of all the 1st
   // party extension IDs whose URLs won't be redacted. It is OK to pass null for
   // that value if it's OK to redact those URLs or they won't be present.
-  explicit RedactionTool(const char* const* first_party_extension_ids);
+  explicit RedactionTool(base::span<const char *const>first_party_extension_ids);
   // The `metrics_recorder` is the instance of recorder that should be used on
   // this instance instead of the default for the platform.
-  RedactionTool(const char* const* first_party_extension_ids,
+  RedactionTool(base::span<const char *const>first_party_extension_ids,
                 std::unique_ptr<RedactionToolMetricsRecorder> metrics_recorder);
   ~RedactionTool();
 
@@ -176,7 +178,7 @@ class RedactionTool {
 
   // Null-terminated list of first party extension IDs. We need to have this
   // passed into us because we can't refer to the code where these are defined.
-  raw_ptr<const char* const> first_party_extension_ids_;  // Not owned.
+  base::raw_span<const char* const> first_party_extension_ids_;  // Not owned.
 
   // Map of MAC addresses discovered in redacted strings to redacted
   // representations. 11:22:33:44:55:66 gets redacted to
@@ -230,10 +232,10 @@ class RedactionToolContainer
  public:
   explicit RedactionToolContainer(
       scoped_refptr<base::SequencedTaskRunner> task_runner,
-      const char* const* first_party_extension_ids);
+      base::span<const char *const>first_party_extension_ids);
   explicit RedactionToolContainer(
       scoped_refptr<base::SequencedTaskRunner> task_runner,
-      const char* const* first_party_extension_ids,
+      base::span<const char *const>first_party_extension_ids,
       std::unique_ptr<RedactionToolMetricsRecorder> metrics_recorder);
 
   // Returns a pointer to the instance of this redactor. May only be called
diff --git a/components/feedback/system_logs/system_logs_fetcher.cc b/components/feedback/system_logs/system_logs_fetcher.cc
index 3a18cda12b541..b592b84c18fd1 100644
--- a/components/feedback/system_logs/system_logs_fetcher.cc
+++ b/components/feedback/system_logs/system_logs_fetcher.cc
@@ -57,7 +57,7 @@ void Redact(redaction::RedactionTool* redactor, SystemLogsResponse* response) {
 
 SystemLogsFetcher::SystemLogsFetcher(
     bool scrub_data,
-    const char* const first_party_extension_ids[])
+    base::span<const char* const> first_party_extension_ids)
     : response_(std::make_unique<SystemLogsResponse>()),
       num_pending_requests_(0),
       task_runner_for_redactor_(
diff --git a/components/feedback/system_logs/system_logs_fetcher.h b/components/feedback/system_logs/system_logs_fetcher.h
index b4d121f8928b0..31d541a415b9d 100644
--- a/components/feedback/system_logs/system_logs_fetcher.h
+++ b/components/feedback/system_logs/system_logs_fetcher.h
@@ -12,6 +12,7 @@
 #include <string>
 #include <vector>
 
+#include "base/containers/span.h"
 #include "base/functional/callback.h"
 #include "base/memory/weak_ptr.h"
 #include "base/sequence_checker.h"
@@ -47,8 +48,9 @@ class SystemLogsFetcher {
   // |first_party_extension_ids| is a null terminated array of all the 1st
   // party extension IDs whose URLs won't be redacted. It is OK to pass null for
   // that value if it's OK to redact those URLs or they won't be present.
-  explicit SystemLogsFetcher(bool scrub_data,
-                             const char* const first_party_extension_ids[]);
+  explicit SystemLogsFetcher(
+      bool scrub_data,
+      base::span<const char* const> first_party_extension_ids);
 
   SystemLogsFetcher(const SystemLogsFetcher&) = delete;
   SystemLogsFetcher& operator=(const SystemLogsFetcher&) = delete;
diff --git a/extensions/shell/browser/system_logs/shell_system_logs_fetcher.cc b/extensions/shell/browser/system_logs/shell_system_logs_fetcher.cc
index ded7546573c16..be1e9e4051697 100644
--- a/extensions/shell/browser/system_logs/shell_system_logs_fetcher.cc
+++ b/extensions/shell/browser/system_logs/shell_system_logs_fetcher.cc
@@ -14,7 +14,7 @@ SystemLogsFetcher* BuildShellSystemLogsFetcher(
   // Deletes itself after Fetch() is completes.
   SystemLogsFetcher* fetcher =
       new SystemLogsFetcher(/* scrub_data= */ true,
-                            /* first_party_extension_ids= */ nullptr);
+                            /* first_party_extension_ids= */ {});
   fetcher->AddSource(std::make_unique<BasicLogSource>(browser_context));
   return fetcher;
 }
