mirror of
https://gitlab.freedesktop.org/xorg/lib/libxcb-errors.git
synced 2025-12-20 04:40:02 +01:00
Re-add a missing length check
This check was accidentally removed in commit 4ed12c46de.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
54e2145e11
commit
ac6b8d8912
2 changed files with 6 additions and 2 deletions
|
|
@ -200,7 +200,8 @@ const char *xcb_errors_get_name_for_core_event(xcb_errors_context_t *ctx,
|
|||
best = current;
|
||||
}
|
||||
|
||||
if (best == NULL || best->first_event == 0) {
|
||||
if (best == NULL || best->first_event == 0
|
||||
|| event_code - best->first_event >= best->static_info->num_events) {
|
||||
/* Nothing found */
|
||||
return get_strings_entry(xproto_info.strings_events, event_code);
|
||||
}
|
||||
|
|
@ -237,7 +238,8 @@ const char *xcb_errors_get_name_for_error(xcb_errors_context_t *ctx,
|
|||
best = current;
|
||||
}
|
||||
|
||||
if (best == NULL || best->first_error == 0) {
|
||||
if (best == NULL || best->first_error == 0
|
||||
|| error_code - best->first_error >= best->static_info->num_errors) {
|
||||
/* Nothing found */
|
||||
return get_strings_entry(xproto_info.strings_errors, error_code);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -347,11 +347,13 @@ static int test_valid_connection(void)
|
|||
err |= check_error(ctx, XCB_IMPLEMENTATION, "Implementation", NULL);
|
||||
err |= check_error(ctx, 18, "Unknown (18)", NULL);
|
||||
err |= check_error(ctx, 127, "Unknown (127)", NULL);
|
||||
err |= check_error(ctx, 0xff, "Unknown (255)", NULL);
|
||||
|
||||
err |= check_event(ctx, XCB_KEY_PRESS, "KeyPress", NULL);
|
||||
err |= check_event(ctx, XCB_KEY_RELEASE, "KeyRelease", NULL);
|
||||
err |= check_event(ctx, XCB_GE_GENERIC, "GeGeneric", NULL);
|
||||
err |= check_event(ctx, 36, "Unknown (36)", NULL);
|
||||
err |= check_event(ctx, 127, "Unknown (127)", NULL);
|
||||
|
||||
err |= test_randr(c, ctx);
|
||||
err |= test_xinput(c, ctx);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue