In certain cases, the .pdsc file that is downloaded has turned out to not be XML in the PDSC schema. CPM should validate that downloaded .pdsc files are indeed XML. It doesn't need to run a full verification against the schema; simply checking for <?xml version="1.0" encoding="UTF-8"?> and the opening <package> element are sufficient.
CPM should also verify that downloaded .pack files are indeed Zip archives. It can probably use a very simple test of the magic number (see the Wikipedia article). While not completely reliable, it should hopefully be sufficient for CPM's needs due to the pack format being constrained (not arbitrary zip files).
In certain cases, the .pdsc file that is downloaded has turned out to not be XML in the PDSC schema. CPM should validate that downloaded .pdsc files are indeed XML. It doesn't need to run a full verification against the schema; simply checking for
<?xml version="1.0" encoding="UTF-8"?>and the opening<package>element are sufficient.CPM should also verify that downloaded .pack files are indeed Zip archives. It can probably use a very simple test of the magic number (see the Wikipedia article). While not completely reliable, it should hopefully be sufficient for CPM's needs due to the pack format being constrained (not arbitrary zip files).