1
0
mirror of https://github.com/yurisieucuti/treble_evolution.git synced 2024-11-24 09:46:19 +00:00
treble_evolution/patches/platform_packages_modules_Connectivity/0005-BpfNetMaps-check-if-map-is-null-to-prevent-crash-on-.patch
2024-04-24 15:13:17 +00:00

30 lines
1.1 KiB
Diff

From 43dc551ae6c85fb209b84959926a041113544237 Mon Sep 17 00:00:00 2001
From: Alberto Ponces <ponces26@gmail.com>
Date: Tue, 30 Jan 2024 16:17:43 +0000
Subject: [PATCH 05/13] BpfNetMaps: check if map is null to prevent crash on
BPF-less devices
Change-Id: I46a949a80e7de0c2d75743445289a778a881a27e
---
service/src/com/android/server/BpfNetMaps.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/service/src/com/android/server/BpfNetMaps.java b/service/src/com/android/server/BpfNetMaps.java
index 029c1e2de1..fae518c739 100644
--- a/service/src/com/android/server/BpfNetMaps.java
+++ b/service/src/com/android/server/BpfNetMaps.java
@@ -936,7 +936,9 @@ public class BpfNetMaps {
// deletion. netd and skDestroyListener could delete CookieTagMap entry concurrently.
// So using Set to count the number of entry in the map.
Set<K> keySet = new ArraySet<>();
- map.forEach((k, v) -> keySet.add(k));
+ if (map != null) {
+ map.forEach((k, v) -> keySet.add(k));
+ }
return keySet.size();
}
--
2.25.1