From 92d283c026b66ae772b4343f366f0da6321daa28 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Mon, 6 Mar 2017 17:23:56 +0100 Subject: Fix MDEV-12142 crash when creating CSV table Was an unprepared longjmp (now throw) Also fix a wrong calculation of To_Line sometimes causing a crash because of buffer overflow. modified: storage/connect/tabdos.cpp Fix a wrong setting of USER for JDBC tables in connect_assisted_discovery. Update jdbc_new.test after that fix, which changed errors. modified: storage/connect/ha_connect.cc modified: storage/connect/mysql-test/connect/r/jdbc_new.result modified: storage/connect/mysql-test/connect/t/jdbc_new.test Make using try/catch/throw the default option modified: storage/connect/CMakeLists.txt Typo modified: storage/connect/xindex.cpp Replace setjmp-longjmp's by try_catch-throw modified: storage/connect/CMakeLists.txt modified: storage/connect/array.cpp modified: storage/connect/blkfil.cpp modified: storage/connect/colblk.cpp modified: storage/connect/connect.cc modified: storage/connect/filamtxt.cpp modified: storage/connect/filamvct.cpp modified: storage/connect/filter.cpp modified: storage/connect/global.h modified: storage/connect/ha_connect.cc modified: storage/connect/jdbconn.cpp modified: storage/connect/json.cpp modified: storage/connect/jsonudf.cpp modified: storage/connect/odbconn.cpp modified: storage/connect/osutil.c modified: storage/connect/plgdbutl.cpp deleted: storage/connect/plugutil.c added: storage/connect/plugutil.cpp modified: storage/connect/tabdos.cpp modified: storage/connect/tabfix.cpp modified: storage/connect/tabfmt.cpp modified: storage/connect/tabjdbc.cpp modified: storage/connect/tabjdbc.h modified: storage/connect/tabjson.cpp modified: storage/connect/tabmul.cpp modified: storage/connect/tabmul.h modified: storage/connect/tabmysql.cpp modified: storage/connect/tabodbc.cpp modified: storage/connect/tabodbc.h modified: storage/connect/tabpivot.cpp modified: storage/connect/tabsys.cpp modified: storage/connect/tabvct.cpp modified: storage/connect/tabvir.cpp modified: storage/connect/tabxml.cpp modified: storage/connect/valblk.cpp modified: storage/connect/value.cpp modified: storage/connect/xindex.cpp modified: storage/connect/xobject.cpp --- storage/connect/tabmul.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'storage/connect/tabmul.cpp') diff --git a/storage/connect/tabmul.cpp b/storage/connect/tabmul.cpp index 78adde81d12..8f1e6f3819d 100644 --- a/storage/connect/tabmul.cpp +++ b/storage/connect/tabmul.cpp @@ -958,8 +958,12 @@ void DIRCOL::ReadColumn(PGLOBAL g) #endif // !__WIN__ default: sprintf(g->Message, MSG(INV_DIRCOL_OFST), N); - longjmp(g->jumper[g->jump_level], GetAmType()); - } // endswitch N +#if defined(USE_TRY) + throw GetAmType(); +#else // !USE_TRY + longjmp(g->jumper[g->jump_level], GetAmType()); +#endif // !USE_TRY + } // endswitch N } // end of ReadColumn @@ -1423,8 +1427,12 @@ void TDBDHR::CloseDB(PGLOBAL g) // Close the search handle. if (!FindClose(Hsearch)) { strcpy(g->Message, MSG(SRCH_CLOSE_ERR)); - longjmp(g->jumper[g->jump_level], GetAmType()); - } // endif FindClose +#if defined(USE_TRY) + throw GetAmType(); +#else // !USE_TRY + longjmp(g->jumper[g->jump_level], GetAmType()); +#endif // !USE_TRY + } // endif FindClose iFile = 0; Hsearch = INVALID_HANDLE_VALUE; -- cgit v1.2.1