Comment 8 for bug 1495173

Revision history for this message
Lars Karlitski (larsu) wrote :

This is not a bug in glib. UploadBlacklist() loops through a list of strings with

  for (auto item : blacklist_)
    // do something with item.c_str()

which makes a copy of each string in every iteration. This means that item.c_str() is not valid anymore after the loop finishes. g_settings_set_strv() then rightly complains about invalid utf8 from whatever is lying around at those memory addresses then.

The attached branch fixes this by using a const reference in the loop.