Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af33dd43 authored by Steve Kondik's avatar Steve Kondik
Browse files

profiles: Handle corrupt profiles.xml

If profiles.xml is corrupt or is an empty file, the parser will
go into an infinite loop because no check for END_DOCUMENT is done.

Add the check to avoid a freeze on boot.

Change-Id: I9216d85663928a030260136f027fae775c8df684
parent 5b2d41b1
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -416,6 +416,8 @@ public class ProfileManagerService extends IProfileManager.Stub {
                    NotificationGroup ng = NotificationGroup.fromXml(xpp, context);
                    addNotificationGroupInternal(ng);
                }
            } else if (event == XmlPullParser.END_DOCUMENT) {
                throw new IOException("Premature end of file while reading " + PROFILE_FILENAME);
            }
            event = xpp.next();
        }