Skip to content

Commit

Permalink
crushtool: Don't crash when called on a file that isn't a crushmap
Browse files Browse the repository at this point in the history
Fixes: ceph#8286
Signed-off-by: Brad Hubbard <[email protected]>
  • Loading branch information
badone committed Mar 11, 2016
1 parent 4fdd10d commit 7663b9f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/tools/crushtool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,12 @@ int main(int argc, const char **argv)
}
}
bufferlist::iterator p = bl.begin();
crush.decode(p);
try {
crush.decode(p);
} catch(...) {
cerr << me << ": unable to decode " << infn << std::endl;
exit(EXIT_FAILURE);
}
}

if (compile) {
Expand Down

0 comments on commit 7663b9f

Please sign in to comment.