Program: 195904
Project: 195904
Buggy source:
private void readUserListLocked(){
  if (!mUserListFile.exists()) {
    fallbackToSingleUserLocked();
    return;
  }
  FileInputStream fis=null;
  AtomicFile userListFile=new AtomicFile(mUserListFile);
  try {
    fis=userListFile.openRead();
    XmlPullParser parser=Xml.newPullParser();
    parser.setInput(fis,null);
    int type;
    while ((type=parser.next()) != XmlPullParser.START_TAG && type != XmlPullParser.END_DOCUMENT) {
      ;
    }
    if (type != XmlPullParser.START_TAG) {
      Slog.e(LOG_TAG,"String_Node_Str");
      fallbackToSingleUserLocked();
      return;
    }
    mNextSerialNumber=-1;
    if (parser.getName().equals(TAG_USERS)) {
      String lastSerialNumber=parser.getAttributeValue(null,ATTR_NEXT_SERIAL_NO);
      if (lastSerialNumber != null) {
        mNextSerialNumber=Integer.parseInt(lastSerialNumber);
      }
      String versionNumber=parser.getAttributeValue(null,ATTR_USER_VERSION);
      if (versionNumber != null) {
        mUserVersion=Integer.parseInt(versionNumber);
      }
    }
    while ((type=parser.next()) != XmlPullParser.END_DOCUMENT) {
      if (type == XmlPullParser.START_TAG) {
        final String name=parser.getName();
        if (name.equals(TAG_USER)) {
          String id=parser.getAttributeValue(null,ATTR_ID);
          UserInfo user=readUserLocked(Integer.parseInt(id));
          if (user != null) {
            mUsers.put(user.id,user);
            if (mNextSerialNumber < 0 || mNextSerialNumber <= user.id) {
              mNextSerialNumber=user.id + 1;
            }
          }
        }
 else         if (name.equals(TAG_GUEST_RESTRICTIONS)) {
          mGuestRestrictions.clear();
          readRestrictionsLocked(parser,mGuestRestrictions);
        }
      }
    }
    updateUserIdsLocked();
    upgradeIfNecessaryLocked();
  }
 catch (  IOException ioe) {
    fallbackToSingleUserLocked();
  }
catch (  XmlPullParserException pe) {
    fallbackToSingleUserLocked();
  }
 finally {
    if (fis != null) {
      try {
        fis.close();
      }
 catch (      IOException e) {
      }
    }
  }
}

Fixed version (ground truth):
private void readUserListLocked(){
  if (!mUserListFile.exists()) {
    fallbackToSingleUserLocked();
    return;
  }
  FileInputStream fis=null;
  AtomicFile userListFile=new AtomicFile(mUserListFile);
  try {
    fis=userListFile.openRead();
    XmlPullParser parser=Xml.newPullParser();
    parser.setInput(fis,null);
    int type;
    while ((type=parser.next()) != XmlPullParser.START_TAG && type != XmlPullParser.END_DOCUMENT) {
      ;
    }
    if (type != XmlPullParser.START_TAG) {
      Slog.e(LOG_TAG,"String_Node_Str");
      fallbackToSingleUserLocked();
      return;
    }
    mNextSerialNumber=-1;
    if (parser.getName().equals(TAG_USERS)) {
      String lastSerialNumber=parser.getAttributeValue(null,ATTR_NEXT_SERIAL_NO);
      if (lastSerialNumber != null) {
        mNextSerialNumber=Integer.parseInt(lastSerialNumber);
      }
      String versionNumber=parser.getAttributeValue(null,ATTR_USER_VERSION);
      if (versionNumber != null) {
        mUserVersion=Integer.parseInt(versionNumber);
      }
    }
    while ((type=parser.next()) != XmlPullParser.END_DOCUMENT) {
      if (type == XmlPullParser.START_TAG) {
        final String name=parser.getName();
        if (name.equals(TAG_USER)) {
          String id=parser.getAttributeValue(null,ATTR_ID);
          UserInfo user=readUserLocked(Integer.parseInt(id));
          if (user != null) {
            mUsers.put(user.id,user);
            if (mNextSerialNumber < 0 || mNextSerialNumber <= user.id) {
              mNextSerialNumber=user.id + 1;
            }
          }
        }
 else         if (name.equals(TAG_GUEST_RESTRICTIONS)) {
          while ((type=parser.next()) != XmlPullParser.END_DOCUMENT && type != XmlPullParser.END_TAG) {
            if (type == XmlPullParser.START_TAG) {
              if (parser.getName().equals(TAG_RESTRICTIONS)) {
                readRestrictionsLocked(parser,mGuestRestrictions);
              }
              break;
            }
          }
        }
      }
    }
    updateUserIdsLocked();
    upgradeIfNecessaryLocked();
  }
 catch (  IOException ioe) {
    fallbackToSingleUserLocked();
  }
catch (  XmlPullParserException pe) {
    fallbackToSingleUserLocked();
  }
 finally {
    if (fis != null) {
      try {
        fis.close();
      }
 catch (      IOException e) {
      }
    }
  }
}