On 04/13/2016 10:36 AM, Eric Blake wrote:
>> static void qmp_input_pop(QmpInputVisitor *qiv, Error **errp)
>> {
>> assert(qiv->nb_stack > 0);
>>
>> if (qiv->strict) {
>> GHashTable * const top_ht = qiv->stack[qiv->nb_stack - 1].h;
>> if (top_ht) {
>> GHashTableIter iter;
>> const char *key;
>>
>> g_hash_table_iter_init(&iter, top_ht);
>> if (g_hash_table_iter_next(&iter, (void **)&key, NULL)) {
>> error_setg(errp, QERR_QMP_EXTRA_MEMBER, key);
>>
>> This looks wrong. If we have more than one extra members, the second
>> call error_setg() will fail an assertion in error_setv(), unless errp is
>> null.
>
> Whoops - looks like f96493b1 is broken for missing a 'break' statement.
> I'll send that as a separate for-2.6 cleanup that we should pull sooner
> rather than later.Scratch that, there's no error. The outer statement is an 'if', not a 'for', so there's nothing to break out of. The error gets set at most once, regardless of whether there are additional unvisited members. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
