X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fui%2Fgui%2Fpsppire-var-store.c;h=aadc585548582fc79629dca6b580e271ad6c7cde;hb=f8b5521cc615eeac897110ee13a44f49d63a21d9;hp=8c400890a86667642b5681a71b8d02cdd3b8208e;hpb=ec9f29af8794a00c495c9dd9ecbb884c6d5d7f08;p=pspp-builds.git diff --git a/src/ui/gui/psppire-var-store.c b/src/ui/gui/psppire-var-store.c index 8c400890..aadc5855 100644 --- 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