[sheepdog] [PATCH] sheep: fix missing trailing '\0' in the store list string

Christoph Hellwig hch at infradead.org
Sun May 20 16:39:51 CEST 2012


On Sun, May 20, 2012 at 11:27:33PM +0900, MORITA Kazutaka wrote:
> @@ -312,7 +312,7 @@ static int local_get_store_list(struct request *req)
>  	list_for_each_entry(driver, &store_drivers, list) {
>  		strbuf_addf(&buf, "%s ", driver->name);
>  	}
> -	memcpy(req->data, buf.buf, buf.len);
> +	memcpy(req->data, buf.buf, buf.len + 1);

Can we add a strbuf_copyout helper to avoid this bitfall for other
users?




More information about the sheepdog mailing list