-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi,
I'm sorry, I missed one problem in my earlier reviews of this change:
Am 2015-02-26 um 04:31 schrieb Alistair Leslie-Hughes:
case DPNA_DATATYPE_STRING:
if (((strlenW((WCHAR*)lpvData)+1)*sizeof(WCHAR)) != dwDataSize)
return DPNERR_INVALIDPARAM; heap_free(entry->data.string);
At the time when you do the check and the error return you have already allocated a new entry and added it to the list. Thus if the check fails you'll leave a zombie component attached to the address object. This also applies to the already existing DWORD size check.
You can move the check in front of the loop that searches if such a component name already exists. I also recommend to to write extra tests for these cases: What happens if a new component with an invalid data size is added? Does GetComponentByName return something? What happens if a component already exists and you try to re-add it with an invalid data? Does the old data stay intact?
The other two patches look good to me and seem to apply without this one. I'll inform Alexandre on IRC. The subject of patch 3 is broken though, maybe Alexandre can correct it.