budb: SBUDB_FindLatestDump should check result of FillDumpEntry 12/13312/2
authorMark Vitale <mvitale@sinenomine.net>
Tue, 11 Sep 2018 19:59:41 +0000 (15:59 -0400)
committerBenjamin Kaduk <kaduk@mit.edu>
Tue, 11 Sep 2018 22:47:16 +0000 (18:47 -0400)
FillDumpEntry may return an error, but FindLatestDump doesn't check its
result.  Therefore, SBUDB_FindLatestDump may return invalid results.

Instead, check the return code from FillDumpEntry and abort the call if
it fails.

Change-Id: If0b44ba2a12a76511129d77110ef669b00780ff0
Reviewed-on: https://gerrit.openafs.org/13312
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

src/budb/procs.c

index f976ff3..cf35576 100644 (file)
@@ -2230,7 +2230,9 @@ FindLatestDump(struct rx_call *call, char *vsname, char *dumpPath,
 
   finished:
     /* return the dump found */
-    FillDumpEntry(ut, retdbaddr, dumpentry);
+    eval = FillDumpEntry(ut, retdbaddr, dumpentry);
+    if (eval)
+       ABORT(eval);
 
     code = ubik_EndTrans(ut);
     return (code);