[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pspp-cvs] pspp/src/ui/gui psppire-data-store.c
From: |
John Darrington |
Subject: |
[Pspp-cvs] pspp/src/ui/gui psppire-data-store.c |
Date: |
Mon, 09 Jul 2007 11:31:17 +0000 |
CVSROOT: /sources/pspp
Module name: pspp
Changes by: John Darrington <jmd> 07/07/09 11:31:17
Modified files:
src/ui/gui : psppire-data-store.c
Log message:
Prevent crash when attempting to insert cases when dictionary is empty.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/psppire-data-store.c?cvsroot=pspp&r1=1.44&r2=1.45
Patches:
Index: psppire-data-store.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/psppire-data-store.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -b -r1.44 -r1.45
--- psppire-data-store.c 8 Jul 2007 10:49:31 -0000 1.44
+++ psppire-data-store.c 9 Jul 2007 11:31:17 -0000 1.45
@@ -466,10 +466,10 @@
struct ccase cc;
g_return_val_if_fail (ds, FALSE);
-
- /* Opportunity for optimisation exists here when creating a blank case */
val_cnt = datasheet_get_column_cnt (ds->case_file->datasheet) ;
+ g_return_val_if_fail (val_cnt > 0, FALSE);
+
case_create (&cc, val_cnt);
memset ( case_data_rw_idx (&cc, 0), 0, val_cnt * MAX_SHORT_STRING);
- [Pspp-cvs] pspp/src/ui/gui psppire-data-store.c,
John Darrington <=