Windows: Add data validation to ktc_xxxx functions that perform pioctls
authorJeffrey Altman <jaltman@secure-endpoints.com>
Sun, 6 Sep 2009 19:10:56 +0000 (15:10 -0400)
committerJeffrey Altman <jaltman|account-1000011@unknown>
Wed, 9 Sep 2009 04:28:25 +0000 (21:28 -0700)
commit0f7efd94fa12cf82efe6c31ee33d9b3ca51666e1
tree408f904d30a17f74c18f3ccf08c96674b1529310
parentf7085c38e15db15e2795ff33e9b54977e703a097
Windows: Add data validation to ktc_xxxx functions that perform pioctls

The ktc_GetToken and ktc_ListTokens functions perform a pioctl
and then parse the response data.  There is no validation that the
data required is not longer than the pioctl output or that the
data received fits into the data structures that are being written.
As a result, random crashes have occurred when the wrong data
has been received from the pioctl.

This commit adds data validation to at least ensure that these
functions cannot read beyond the data provided or write beyond
the allocated memory.

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/405
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Asanka Herath <asanka@secure-endpoints.com>
Tested-by: Asanka Herath <asanka@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
src/auth/ktc_nt.c