Commit 3a9ac85e authored by Matthias Clasen's avatar Matthias Clasen Committed by Cosimo Cecchi
Browse files

Fix an off-by-one in logview_prefs_store_log

When writing to stored_logs[old_size + 1], stored_logs must have
a length of old_size + 2.
parent 1bba6dd1
......@@ -412,7 +412,7 @@ logview_prefs_store_log (LogviewPrefs *prefs, GFile *file)
if (!found) {
old_size = g_strv_length (stored_logs);
stored_logs = g_realloc (stored_logs, (old_size + 1) * sizeof (gchar *));
stored_logs = g_realloc (stored_logs, (old_size + 2) * sizeof (gchar *));
stored_logs[old_size] = g_file_get_parse_name (file);
stored_logs[old_size + 1] = NULL;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment