Don't allow clients to update or insert _data column data
Bug 8214355
Change-Id: I45c93047ced465277a46c6a33d6ef590ab0bf8bb
diff --git a/src/com/android/providers/telephony/MmsProvider.java b/src/com/android/providers/telephony/MmsProvider.java
index bddce1d..3b17003 100644
--- a/src/com/android/providers/telephony/MmsProvider.java
+++ b/src/com/android/providers/telephony/MmsProvider.java
@@ -266,6 +266,10 @@
@Override
public Uri insert(Uri uri, ContentValues values) {
+ // Don't let anyone insert anything with the _data column
+ if (values != null && values.containsKey(Part._DATA)) {
+ return null;
+ }
int msgBox = Mms.MESSAGE_BOX_ALL;
boolean notify = true;
@@ -680,6 +684,10 @@
@Override
public int update(Uri uri, ContentValues values,
String selection, String[] selectionArgs) {
+ // Don't let anyone update the _data column
+ if (values != null && values.containsKey(Part._DATA)) {
+ return 0;
+ }
int match = sURLMatcher.match(uri);
if (LOCAL_LOGV) {
Log.v(TAG, "Update uri=" + uri + ", match=" + match);