projects
/
pspp-builds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ec9f29a
)
Prevent invalid variable widths in variable sheet.
author
John Darrington
<john@darrington.wattle.id.au>
Mon, 11 May 2009 23:18:31 +0000
(07:18 +0800)
committer
Ben Pfaff
<blp@gnu.org>
Sun, 7 Jun 2009 04:11:11 +0000
(21:11 -0700)
src/ui/gui/psppire-var-store.c
patch
|
blob
|
history
diff --git
a/src/ui/gui/psppire-var-store.c
b/src/ui/gui/psppire-var-store.c
index 8c400890a86667642b5681a71b8d02cdd3b8208e..aadc585548582fc79629dca6b580e271ad6c7cde 100644
(file)
--- a/
src/ui/gui/psppire-var-store.c
+++ b/
src/ui/gui/psppire-var-store.c
@@
-484,10
+484,19
@@
psppire_var_store_set_string (PsppireSheetModel *model,
break;
case PSPPIRE_VAR_STORE_COL_WIDTH:
{
- int width = atoi (text);
- if ( ! text) return FALSE;
+ const int width = atoi (text);
+ if ( ! text)
+ return FALSE;
+
+ if (width < 0)
+ return FALSE;
+
if ( var_is_alpha (pv))
+ {
+ if ( width > MAX_STRING )
+ return FALSE;
var_set_width (pv, width);
+ }
else
{
bool for_input