Skip to content

Commit 0c0a3f8

Browse files
Return defensive copy of data in RemoteMessage
b/438714642: This change ensures we do not return the internal map but rather a defensive copy of data. Makes our code less vulnerable.
1 parent 0afe7cb commit 0c0a3f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

firebase-messaging/src/main/java/com/google/firebase/messaging/RemoteMessage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public Map<String, String> getData() {
131131
if (data == null) {
132132
data = MessagePayloadKeys.extractDeveloperDefinedPayload(bundle);
133133
}
134-
return data;
134+
return new HashMap<>(data);
135135
}
136136

137137
/** @hide */

0 commit comments

Comments
 (0)