diff options
author | Aaron Plattner <aplattner@nvidia.com> | 2010-10-17 11:12:52 -0700 |
---|---|---|
committer | Aaron Plattner <aplattner@nvidia.com> | 2010-10-18 16:16:03 -0700 |
commit | 00155fba2c650c86900a7a7ce68fefff10dce3de (patch) | |
tree | 592e4df5f39337476241262aaa8f2d8b47fad1ba | |
parent | 3594ee0265a0fbb01458b3448d902978bb340833 (diff) |
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 <aplattner@nvidia.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | xts5/src/libproto/MakeReq.c | 12 |
1 files changed, 11 insertions, 1 deletions
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)); |