pspp-dev
[Top][All Lists]
Advanced

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

Re: Possible Bug in src/output/cairo.c


From: Ben Pfaff
Subject: Re: Possible Bug in src/output/cairo.c
Date: Sat, 12 Jan 2013 09:44:38 -0800
User-agent: Mutt/1.5.21 (2010-09-15)

On Sat, Jan 12, 2013 at 09:14:45AM +0100, John Darrington wrote:
> It would seem that the command_name member of the struct xr_driver is
> used and freed, but never initialised.

It was at least initialized to null by the xzalloc() that created the
xr_driver, but yes it failed to ever be set to anything useful.

I fixed the problem with the following commit.

--8<--------------------------cut here-------------------------->8--

From: Ben Pfaff <address@hidden>
Date: Sat, 12 Jan 2013 09:43:18 -0800
Subject: [PATCH] cairo: Include command name in error messages.

Commit ddb7b52128d8 (output: Make errors, warnings, and notes into a new
"message_item".) changed command name tracking to a responsibility of
individual output drivers, and converted the output drivers to do it.
However, the conversion of the cairo driver was incomplete.  This commit
fixes that problem.

Reported by John Darrington.
---
 src/output/cairo.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/output/cairo.c b/src/output/cairo.c
index 89013c2..776f7f5 100644
--- a/src/output/cairo.c
+++ b/src/output/cairo.c
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -524,6 +524,8 @@ xr_submit (struct output_driver *driver, const struct 
output_item *output_item)
 {
   struct xr_driver *xr = xr_driver_cast (driver);
 
+  output_driver_track_current_command (output_item, &xr->command_name);
+
   xr_driver_output_item (xr, output_item);
   while (xr_driver_need_new_page (xr))
     {
-- 
1.7.10.4




reply via email to

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