[PATCH] xf86VIDrvMsgVerb: Use provided format if asprintf fails

Alan Coopersmith alan.coopersmith at oracle.com
Thu Jul 21 21:05:23 PDT 2011


On 07/21/11 09:01 PM, Daniel Kurtz wrote:
> If asprintf fails when attempting to allocate space for the driver name,
> use the originally requested format, instead of just "%s".
> 
> Signed-off-by: Daniel Kurtz <djkurtz at google.com>
> ---
>  hw/xfree86/common/xf86Helper.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
> index 3cdffdb..b19d1a0 100644
> --- a/hw/xfree86/common/xf86Helper.c
> +++ b/hw/xfree86/common/xf86Helper.c
> @@ -1091,7 +1091,7 @@ xf86VIDrvMsgVerb(InputInfoPtr dev, MessageType type, int verb, const char *forma
>  
>      if (asprintf(&msg, "%s: %s: %s", dev->drv->driverName, dev->name, format)
>  	== -1) {
> -	LogVMessageVerb(type, verb, "%s", args);
> +	LogVMessageVerb(type, verb, format, args);
>      } else {
>  	LogVMessageVerb(type, verb, msg, args);
>  	free(msg);

Oops.
Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>

-- 
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System



More information about the xorg-devel mailing list