projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Prevent invalid variable widths in variable sheet.
[pspp-builds.git]
/
src
/
ui
/
gui
/
psppire-var-store.c
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:
{
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 ( var_is_alpha (pv))
+ {
+ if ( width > MAX_STRING )
+ return FALSE;
var_set_width (pv, width);
var_set_width (pv, width);
+ }
else
{
bool for_input
else
{
bool for_input