From 00155fba2c650c86900a7a7ce68fefff10dce3de Mon Sep 17 00:00:00 2001 From: Aaron Plattner Date: Sun, 17 Oct 2010 11:12:52 -0700 Subject: xts5: Bail out with UNTESTED for BAD_LENGTH requests that would have length 0 The pBell-2 test sets the test type to BAD_LENGTH, which attempts to create a request with a size that is too small by one long (4 bytes). However, it tries to do this with an xBellReq, which is exactly 4 bytes in size. This results in a request with a length field of 0, which triggers the big request handling in the X server. This makes the server interpret the next request as the size part of the Bell request, and hilarity ensues. Instead, detect this case and bail out with an UNTESTED result. Signed-off-by: Aaron Plattner Acked-by: Peter Hutterer --- xts5/src/libproto/MakeReq.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/xts5/src/libproto/MakeReq.c b/xts5/src/libproto/MakeReq.c index df63ac62..ac0d571a 100644 --- a/xts5/src/libproto/MakeReq.c +++ b/xts5/src/libproto/MakeReq.c @@ -1279,7 +1279,17 @@ int type; case BAD_LENGTH: case JUST_TOO_LONG: case TOO_LONG: - rp->length = bad_len; + if (bad_len == 0 && dpy->bigreq_size > 0) { + Log_Msg("This test sends an invalid request with size zero\n"); + Log_Msg(" which would be interpreted as a Big Request by this\n"); + Log_Msg(" server, so this test cannot be performed.\n"); + Free_Req(rp); + rp = NULL; + Destroy_Client(client); + Untested(); + } else { + rp->length = bad_len; + } break; default: Log_Msg ("INTERNAL ERROR: Make_Req - bad test type %d\n", Get_Test_Type(client)); -- cgit v1.2.3