Revision 54d50be6 qapi/qmp-output-visitor.c

b/qapi/qmp-output-visitor.c
190 190

  
191 191
    assert(strings);
192 192
    while (strings[i++] != NULL);
193
    if (value >= i - 1) {
193
    if (value < 0 || value >= i - 1) {
194 194
        error_set(errp, QERR_INVALID_PARAMETER, name ? name : "null");
195 195
        return;
196 196
    }

Also available in: Unified diff