From 86e729e30eadd455a05bae1fbbe8ec6386caa0f2 Mon Sep 17 00:00:00 2001 From: alexpeshkoff Date: Tue, 17 Jun 2014 12:45:14 +0000 Subject: [PATCH] Fixed CORE-4440: isql crash without connect when execute command "show version" --- src/yvalve/utl.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/yvalve/utl.cpp b/src/yvalve/utl.cpp index c1bafa4164c..de5e425ebb7 100644 --- a/src/yvalve/utl.cpp +++ b/src/yvalve/utl.cpp @@ -367,6 +367,9 @@ void FB_CARG UtlInterface::dumpBlob(IStatus* status, ISC_QUAD* blobId, if (!file) system_error::raise("fopen"); + if (!att) + Arg::Gds(isc_bad_db_handle).raise(); + dump(status, blobId, att, tra, file); } catch (const Exception& ex) @@ -397,6 +400,9 @@ void FB_CARG UtlInterface::loadBlob(IStatus* status, ISC_QUAD* blobId, if (!file) system_error::raise("fopen"); + if (!att) + Arg::Gds(isc_bad_db_handle).raise(); + load(status, blobId, att, tra, file); } catch (const Exception& ex) @@ -423,6 +429,9 @@ void UtlInterface::getFbVersion(IStatus* status, IAttachment* att, **************************************/ try { + if (!att) + Arg::Gds(isc_bad_db_handle).raise(); + UCharBuffer buffer; USHORT buf_len = 256; UCHAR* buf = buffer.getBuffer(buf_len);