Fix restorevol crash on corrupt nDumpTimes value
authorRuss Allbery <rra@stanford.edu>
Sat, 29 Jun 2013 21:27:55 +0000 (14:27 -0700)
committerDerrick Brashear <shadow@your-file-system.com>
Fri, 12 Jul 2013 15:02:37 +0000 (08:02 -0700)
commitd5fb2c2bdccedbd539cb2629cf918d5f37b82c7b
treeb6acddde590db861238aa5ec1ad6d5a952b593f0
parentddf98e50b24b2df3dabdce4ce2720eefa19717f8
Fix restorevol crash on corrupt nDumpTimes value

If the number of dump times claimed in the volume header was greater
than MAXDUMPTIMES, restorevol would happily write over random stack
memory and crash.  Sanity-check the loaded value and cap it to
MAXDUMPTIMES with a warning.

Bug found by Mayhem and reported by Alexandre Rebert.

Change-Id: Ib0edd9b1b6f540d8b0128151333d3bb0a8ef37fa
Reviewed-on: http://gerrit.openafs.org/10025
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
src/volser/restorevol.c