pspp-dev
[Top][All Lists]
Advanced

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

Re: Reviewing covariance-matrix.c and interaction.c


From: Jason Stover
Subject: Re: Reviewing covariance-matrix.c and interaction.c
Date: Sat, 18 Jul 2009 18:29:00 -0400
User-agent: Mutt/1.5.18 (2008-05-17)

On Sun, Jun 21, 2009 at 08:56:07PM -0700, Ben Pfaff wrote:
> Jason Stover <address@hidden> writes:
> 
> > interaction.c and covariance-matrix.c are ready for further review.
> 
> I looked over interaction.c tonight.  I have a few comments, and
> then some proposed commits to resolve those comments.  First the
> comments themselves:
> 
> ----------------------------------------------------------------------
... 
>       * This code allocates space for a string value one piece at a
>           time, but it would be more efficient to allocate the full
>           correct length ahead of time and just copy in the data as
>           necessary.
> 
>       * The width argument passed to value_str_rw is not always
>           correct; for example, after a call to value_resize that
>           passes 'val_width + w' as the new width, 'val_width' is
>           passed to value_str_rw as the width.  This can cause a
>           segfault in the right circumstances.

I agree with this change in principle, and I think I did something like
this to begin with, but this change seems to have caused a segfault here:

      int val_width = var_get_width (interaction_get_variable (var));

val_width is 0, which is the immediate cause. From a brief glance at the
code in main, I don't see why this change would cause a segfault when
the original code doesn't. I'll look into it more closely later.





reply via email to

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