qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC][PATCH v4 02/18] virtagent: base definitions for h


From: Jes Sorensen
Subject: Re: [Qemu-devel] [RFC][PATCH v4 02/18] virtagent: base definitions for host/guest RPC server
Date: Thu, 18 Nov 2010 14:57:40 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101103 Fedora/1.0-0.33.b2pre.fc14 Lightning/1.0b3pre Thunderbird/3.1.6

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

[Prev in Thread] Current Thread [Next in Thread]