~ubuntu-branches/ubuntu/quantal/libsecret/quantal-proposed

« back to all changes in this revision

Viewing changes to libsecret/secret-attributes.c

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-10-31 10:18:13 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20121031101813-eiwj20mut8suteyg
Tags: 0.11-0ubuntu0.12.10.1
New upstream release to fix segfault in vinagre from using an invalid
attribute. (LP: #1071055)

Show diffs side-by-side

added added

removed removed

Lines of Context:
153
153
                }
154
154
 
155
155
                if (!type_found) {
156
 
                        g_warning ("The attribute '%s' was not found in the password schema.", attribute_name);
 
156
                        g_critical ("The attribute '%s' was not found in the password schema.", attribute_name);
157
157
                        g_hash_table_unref (attributes);
158
158
                        return NULL;
159
159
                }
165
165
                        break;
166
166
                case SECRET_SCHEMA_ATTRIBUTE_STRING:
167
167
                        string = va_arg (va, gchar *);
 
168
                        if (string == NULL) {
 
169
                                g_critical ("The value for attribute '%s' was NULL", attribute_name);
 
170
                                return NULL;
 
171
                        }
168
172
                        if (!g_utf8_validate (string, -1, NULL)) {
169
 
                                g_warning ("The value for attribute '%s' was not a valid utf-8 string.", attribute_name);
 
173
                                g_critical ("The value for attribute '%s' was not a valid UTF-8 string.", attribute_name);
170
174
                                g_hash_table_unref (attributes);
171
175
                                return NULL;
172
176
                        }
177
181
                        value = g_strdup_printf ("%d", integer);
178
182
                        break;
179
183
                default:
180
 
                        g_warning ("The password attribute '%s' has an invalid type in the password schema.", attribute_name);
 
184
                        g_critical ("The password attribute '%s' has an invalid type in the password schema.", attribute_name);
181
185
                        g_hash_table_unref (attributes);
182
186
                        return NULL;
183
187
                }
220
224
                }
221
225
 
222
226
                if (attribute == NULL) {
223
 
                        g_critical ("%s: invalid %s attribute in for %s schema",
 
227
                        g_critical ("%s: invalid %s attribute for %s schema",
224
228
                                    pretty_function, key, schema->name);
225
229
                        return FALSE;
226
230
                }