Merge changes Ia3eae81c,Iff44fb23

* changes:
  Fix for: clearAppProfiles interface can cause arbitrary file truncate
  Fix for: copySystemProfile can cause arbitrary file read and write