From daa799fac5b81b221247c581bdeadcebffcab8f3 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sat, 3 Mar 2012 18:46:53 -0600 Subject: In Bug #943747, Coverity reported that use of sscanf() needed to be inspected by a human to verify there aren't buffer overruns. This commit adds /* coverity[secure_coding] */ to the lines before the calls to tell Coverity that they've been checked. --- src/datetime-prefs.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/datetime-prefs.c') diff --git a/src/datetime-prefs.c b/src/datetime-prefs.c index 50445ff..bfe75c0 100644 --- a/src/datetime-prefs.c +++ b/src/datetime-prefs.c @@ -405,6 +405,7 @@ input_time_text (GtkWidget * spinner, gdouble * value, IndicatorDatetimePanel * if (is_locale_12h ()) { // TODO: make this look-at/watch gsettings? char ampm[51]; + /* coverity[secure_coding] */ scanned = sscanf (text, "%u:%u:%u %50s", &hour_in, &minute_in, &second_in, ampm); passed = (scanned == 4); @@ -415,6 +416,7 @@ input_time_text (GtkWidget * spinner, gdouble * value, IndicatorDatetimePanel * } } } else { + /* coverity[secure_coding] */ scanned = sscanf (text, "%u:%u:%u", &hour_in, &minute_in, &second_in); passed = (scanned == 3); } @@ -433,6 +435,7 @@ input_time_text (GtkWidget * spinner, gdouble * value, IndicatorDatetimePanel * else { gint year_in, month_in, day_in; + /* coverity[secure_coding] */ scanned = sscanf (text, "%u-%u-%u", &year_in, &month_in, &day_in); if (scanned != 3 || year_in < 1 || year_in > 9999 || -- cgit v1.2.3