Skip to content

Commit 10fc8a2

Browse files
committed
tools/psim.cc: catch ceph::buffer::end_of_buffer exception
Fix for: CID 717163 (#1 of 1): Uncaught exception (UNCAUGHT_EXCEPT) root_function: In function main(int, char **) an exception of type ceph::buffer::end_of_buffer is thrown and never caught. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
1 parent 5f6b091 commit 10fc8a2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/tools/psim.cc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2+
// vim: ts=8 sw=2 smarttab
13

24
#include "osd/OSDMap.h"
35
#include "include/buffer.h"
@@ -15,7 +17,13 @@ int main(int argc, char **argv)
1517
return 1;
1618
}
1719
OSDMap osdmap;
18-
osdmap.decode(bl);
20+
21+
try {
22+
osdmap.decode(bl);
23+
} catch (ceph::buffer::end_of_buffer &eob) {
24+
cout << "Exception (end_of_buffer) in decode(), exit." << std::endl;
25+
exit(1);
26+
}
1927

2028
//osdmap.set_primary_affinity(0, 0x8000);
2129
//osdmap.set_primary_affinity(3, 0);

0 commit comments

Comments
 (0)