libvirt_domain_change_memory: Don't blindly trust domain XML
libvirt_domain_change_memory: Don't blindly trust domain XML

The way this function works is that we dump domain XML, change it
and the define back. However, when finding the correct place to
perform the change we use couple of strstr()-s and use their
return value without any check. Therefore it may happen that we
crash if the domain XML was malformed in the first place.

Signed-off-by: Michal Privoznik <83d82aaba2eed257f4814b0c239c260c4caaadf0@redhat.com>

libvirt/libvirt-php,zippy2/libvirt-php,zippy2/libvirt-php,zippy2/libvirt-php,libvirt/libvirt-php,libvirt/libvirt-php