From 38adc14676f77dfbeaea07cceab0c8d8e7f800ec Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Mon, 9 Mar 2015 01:16:08 -0700 Subject: [PATCH] SCR: Improve validity testing of settings on Mac Screensaver control panel. --- clientscr/Mac_Saver_ModuleView.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clientscr/Mac_Saver_ModuleView.m b/clientscr/Mac_Saver_ModuleView.m index 13f017d106..b2aa705321 100644 --- a/clientscr/Mac_Saver_ModuleView.m +++ b/clientscr/Mac_Saver_ModuleView.m @@ -552,24 +552,28 @@ print_to_log_file(" Entered closeSheetSave"); gBlankingTime = [ mBlankingTimeString intValue ]; scanner = [ NSScanner scannerWithString:mBlankingTimeString]; if (![ scanner scanInt:&period ]) goto Bad; + if (![ scanner isAtEnd ]) goto Bad; if ((period < 0) || (period > 999)) goto Bad; gBlankingTime = period; mDefaultPeriodString = [ mDefaultPeriodTextField stringValue ]; scanner2 = [ scanner initWithString:mDefaultPeriodString]; if (![ scanner2 scanInt:&period ]) goto Bad; + if (![ scanner2 isAtEnd ]) goto Bad; if ((period < 0) || (period > 999)) goto Bad; setGFXDefaultPeriod((double)(period * 60)); mSciencePeriodString = [ mSciencePeriodTextField stringValue ]; scanner2 = [ scanner initWithString:mSciencePeriodString]; if (![ scanner2 scanInt:&period ]) goto Bad; + if (![ scanner2 isAtEnd ]) goto Bad; if ((period < 0) || (period > 999)) goto Bad; setGFXSciencePeriod((double)(period * 60)); mChangePeriodString = [ mChangePeriodTextField stringValue ]; scanner2 = [ scanner initWithString:mChangePeriodString]; if (![ scanner2 scanInt:&period ]) goto Bad; + if (![ scanner2 isAtEnd ]) goto Bad; if ((period < 0) || (period > 999)) goto Bad; setGGFXChangePeriod((double)(period * 60));