Add array bounds checking in h_Enumerate
authorDan Hyde <drh@umich.edu>
Thu, 29 Oct 2009 16:07:47 +0000 (12:07 -0400)
committerDerrick Brashear <shadow|account-1000005@unknown>
Mon, 2 Nov 2009 22:29:06 +0000 (14:29 -0800)
commit93d48b1735b88b3051357307bdbebf5da9872d69
tree277141e35665e500d460f3b00f27e1d5802339c0
parent715c67f2fb3c1756f0c9cee0bc3258a3e378d3fd
Add array bounds checking in h_Enumerate

When hostList is not properly NULL-terminated, the current code does
not protect from buffer overflow.  The following patch prevents buffer
overflow, prints a message, and asserts.

On our Linux hosts, we never reached the original assert, as there is
a problem handling the segfault the buffer overflow causes.

FIXES 125506

Change-Id: Ifce92c593d17050e45add9e37a7a9ed4fbc377ef
Reviewed-on: http://gerrit.openafs.org/757
Reviewed-by: Dan Hyde <drh@umich.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
src/viced/host.c