]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph_authtool.cc: catch ceph::buffer::end_of_buffer exception
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 12 Nov 2014 15:11:49 +0000 (16:11 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 13 Nov 2014 22:39:09 +0000 (23:39 +0100)
Fix for:

CID 717142 (#1 of 1): Uncaught exception (UNCAUGHT_EXCEPT)
 root_function: In function main(int, char const **) 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>
src/tools/ceph_authtool.cc

index 9156b13a9684b6a9e17c031f964fc0d6f297368a..a4d3baeea92ffd049e70f2ec8df2bb436a1f7139 100644 (file)
@@ -248,7 +248,12 @@ int main(int argc, const char **argv)
 
   // read commands
   if (list) {
-    keyring.print(cout);
+    try {
+      keyring.print(cout);
+    } catch (ceph::buffer::end_of_buffer &eob) {
+      cout << "Exception (end_of_buffer) in print(), exit." << std::endl;
+      exit(1);
+    }
   }
   if (print_key) {
     CryptoKey key;