On 11/16/10 17:01, Michael Roth wrote:
> +#include <syslog.h>
> +#include "qemu_socket.h"
> +#include "virtagent-daemon.h"
> +#include "virtagent-common.h"
> +#include "virtagent.h"
> +
> +static bool va_enable_syslog = false; /* enable syslog'ing of RPCs */
> +
> +#define SLOG(msg, ...) do { \
> +    char msg_buf[1024]; \
> +    if (!va_enable_syslog) { \
> +        break; \
> +    } \
> +    sprintf(msg_buf, msg, ## __VA_ARGS__); \
> +    syslog(LOG_INFO, "virtagent, %s", msg_buf); \
> +} while(0)

You have a potential buffer overflow here, s/sprintf/snprintf/

> +#include "virtproxy.h"
> +
> +#define GUEST_AGENT_SERVICE_ID "virtagent"
> +#define GUEST_AGENT_PATH "/tmp/virtagent-guest.sock"
> +#define HOST_AGENT_SERVICE_ID "virtagent-host"
> +#define HOST_AGENT_PATH "/tmp/virtagent-host.sock"
> +#define VA_GETFILE_MAX 1 << 30
> +#define VA_FILEBUF_LEN 16384
> +
> +int va_server_init(VPDriver *vp_drv, bool is_host);

More stuff which I think should go into a config file.

Jes

Reply via email to