All users of virCommandSetSendBuffer() are using it to send sensitive
data to a child process. So, since these buffers contain sensitive
information, clear it with virSecureErase().
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
#include "virpidfile.h"
#include "virprocess.h"
#include "virbuffer.h"
+#include "virsecureerase.h"
#include "virthread.h"
#include "virstring.h"
for (i = 0; i < virCommandGetNumSendBuffers(cmd); i++) {
VIR_FORCE_CLOSE(cmd->sendBuffers[i].fd);
+ virSecureErase(cmd->sendBuffers[i].buffer, cmd->sendBuffers[i].buflen);
VIR_FREE(cmd->sendBuffers[i].buffer);
}
VIR_FREE(cmd->sendBuffers);