diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2012-03-03 18:46:53 -0600 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2012-03-03 18:46:53 -0600 |
commit | daa799fac5b81b221247c581bdeadcebffcab8f3 (patch) | |
tree | 52f614741613a22489e439fdb6aea3cbbe43676b | |
parent | a7ffebd9859ded9e44ec6a5b5dca9fb771eac209 (diff) | |
download | ayatana-indicator-datetime-daa799fac5b81b221247c581bdeadcebffcab8f3.tar.gz ayatana-indicator-datetime-daa799fac5b81b221247c581bdeadcebffcab8f3.tar.bz2 ayatana-indicator-datetime-daa799fac5b81b221247c581bdeadcebffcab8f3.zip |
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.
-rw-r--r-- | src/datetime-prefs.c | 3 |
1 files changed, 3 insertions, 0 deletions
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 || |