Fix Coverity warning (unsafe fscanf)
authorColin Leroy <colin@colino.net>
Fri, 28 Sep 2018 11:20:26 +0000 (13:20 +0200)
committerAndrej Kacian <ticho@claws-mail.org>
Thu, 4 Oct 2018 17:32:36 +0000 (19:32 +0200)
src/plugins/libravatar/libravatar_missing.c

index d451510be43abff231e6a2e5ff140ff6590c7fa8..5ea99a7abc7185e94696e2723524f5bb715a1d73 100644 (file)
@@ -54,7 +54,7 @@ GHashTable *missing_load_from_file(const gchar *filename)
 
        table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
 
-       while ((r = fscanf(file, "%s %llu\n", md5sum, &seen)) != EOF) {
+       while ((r = fscanf(file, "%32s %llu\n", md5sum, &seen)) != EOF) {
                if (t - (time_t)seen <= LIBRAVATAR_MISSING_TIME) {
                        time_t *value = g_malloc0(sizeof(time_t));
                        *value = (time_t)seen;