]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Fix restorevol sanity check on afs_int32
authorRuss Allbery <rra@stanford.edu>
Sat, 29 Jun 2013 21:29:06 +0000 (14:29 -0700)
committerDerrick Brashear <shadow@your-file-system.com>
Fri, 12 Jul 2013 15:02:48 +0000 (08:02 -0700)
restorevol reads various values of different lengths into an
afs_int32 and does a sanity check to ensure that there is enough
room to store the desired value length.  However, the check was
done against the wrong variable, making it ineffective.

This check is unlikely to ever trigger, but fix it just in case.

Change-Id: Ia81bd9ff9a2ce8e2d93af384c8e8c664f5434d5e
Reviewed-on: http://gerrit.openafs.org/10026
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

index f4a54b7bb8d846a8668a206c5ca7179c47de4dba..c4e0ff7aa1a10d9c77a88643a7febf5be5e9d223 100644 (file)
@@ -77,8 +77,8 @@ readvalue(int size)
     ptr = (char *)&value;
 
     s = sizeof(value) - size;
-    if (size < 0) {
-       fprintf(stderr, "Too much data in afs_int32\n");
+    if (s < 0) {
+       fprintf(stderr, "Too much data for afs_int32\n");
        return 0;
     }