+Thu Mar 15 14:14:20 EST 2007 Daniel P Berrange <berrange@redhat.com>
+
+ * src/qemud_internal.c: Paranoia ensure the XML returned by
+ the getCapabilities call is NULL terminated before strduping
+ to protect from malicious / buggy server
+ * qemud/dispatch.c: Packet length for getCapabilities call
+ should be the size of the reply body, not the size of the
+ XML string.
+
Thu Mar 15 14:14:20 EST 2007 Daniel P Berrange <berrange@redhat.com>
* src/xen_internal.c: Fix missing NULL initializer
return 0;
}
out->header.type = QEMUD_PKT_GET_CAPABILITIES;
- out->header.dataSize = len;
+ out->header.dataSize = sizeof(out->data.getCapabilitiesReply);
strcpy (out->data.getCapabilitiesReply.xml, xml->content);
bufferFree (xml);
return 0;
return NULL;
}
+ reply.data.getCapabilitiesReply.xml[QEMUD_MAX_XML_LEN-1] = '\0';
+
xml = strdup (reply.data.getCapabilitiesReply.xml);
if (!xml) {
qemuError (conn, NULL, VIR_ERR_NO_MEMORY, NULL);