PocoSQLRoleInGatewayDao: fix segfault while extracting Nullable
PocoSQLRoleInGatewayDao: fix segfault while extracting Nullable

The ODBC driver fails when a Nullable<T> value is uninitialized when
passing it to into(). It is not clear, why SQLite works well in this
case. Valgrind report from the segfault:

==3366== Thread 3:
==3366== Invalid read of size 4
==3366==    at 0x769B730: Poco::Data::ODBC::Extractor::extract(unsigned long, unsigned int&) (in /usr/lib/libPocoDataODBC.so.48)
==3366==    by 0x5877512: Poco::Data::TypeHandler<Poco::Nullable<unsigned int> >::extract(unsigned long, Poco::Nullable<unsigned int>&, Poco::Nullable<unsigned int> const&, Poco::SharedPtr<Poco::Data::AbstractExtractor, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::Data::AbstractExtractor> >) (TypeHandler.h:295)
==3366==    by 0x5875E42: Poco::Data::Extraction<Poco::Nullable<unsigned int> >::extract(unsigned long) (Extraction.h:104)
==3366==    by 0x76CBADF: Poco::Data::ODBC::ODBCStatementImpl::next() (in /usr/lib/libPocoDataODBC.so.48)
==3366==    by 0x7004FDA: Poco::Data::StatementImpl::executeWithoutLimit() (in /usr/lib/libPocoData.so.48)
==3366==    by 0x70079FA: Poco::Data::StatementImpl::execute(bool const&) (in /usr/lib/libPocoData.so.48)
==3366==    by 0x700219F: Poco::Data::Statement::execute(bool) (in /usr/lib/libPocoData.so.48)
==3366==    by 0x585C969: BeeeOn::PocoAbstractDao::execute(Poco::Data::Statement&) (PocoAbstractDao.cpp:93)
==3366==    by 0x586FEF0: BeeeOn::PocoSQLRoleInGatewayDao::fetchAccessLevel(BeeeOn::Gateway const&, BeeeOn::User const&) (PocoSQLRoleInGatewayDao.cpp:253)
==3366==    by 0x58BA6B3: BeeeOn::DefaultAccessPolicy::fetchAccessLevel(BeeeOn::User const&, BeeeOn::Gateway const&) (DefaultAccessPolicy.cpp:33)
==3366==    by 0x58BAA1A: BeeeOn::DefaultAccessPolicy::assureGet(BeeeOn::PolicyContext const&, BeeeOn::Gateway const&) (DefaultAccessPolicy.cpp:64)
==3366==    by 0x58A8AD7: BeeeOn::GatewayService::doFetch(BeeeOn::Single<BeeeOn::LegacyGateway>&) (GatewayService.cpp:103)
==3366==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==3366==
==3366==
==3366== Process terminating with default action of signal 6 (SIGABRT): dumping core
==3366==    at 0x8201A10: raise (in /usr/lib/libc-2.25.so)
==3366==    by 0x8203139: abort (in /usr/lib/libc-2.25.so)
==3366==    by 0x5CB6D54: Poco::SignalHandler::handleSignal(int) (in /usr/lib/libPocoFoundation.so.48)
==3366==    by 0x4E48FDF: ??? (in /usr/lib/libpthread-2.25.so)
==3366==    by 0x769B72F: Poco::Data::ODBC::Extractor::extract(unsigned long, unsigned int&) (in /usr/lib/libPocoDataODBC.so.48)
==3366==    by 0x5877512: Poco::Data::TypeHandler<Poco::Nullable<unsigned int> >::extract(unsigned long, Poco::Nullable<unsigned int>&, Poco::Nullable<unsigned int> const&, Poco::SharedPtr<Poco::Data::AbstractExtractor, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::Data::AbstractExtractor> >) (TypeHandler.h:295)
==3366==    by 0x5875E42: Poco::Data::Extraction<Poco::Nullable<unsigned int> >::extract(unsigned long) (Extraction.h:104)
==3366==    by 0x76CBADF: Poco::Data::ODBC::ODBCStatementImpl::next() (in /usr/lib/libPocoDataODBC.so.48)
==3366==    by 0x7004FDA: Poco::Data::StatementImpl::executeWithoutLimit() (in /usr/lib/libPocoData.so.48)
==3366==    by 0x70079FA: Poco::Data::StatementImpl::execute(bool const&) (in /usr/lib/libPocoData.so.48)
==3366==    by 0x700219F: Poco::Data::Statement::execute(bool) (in /usr/lib/libPocoData.so.48)
==3366==    by 0x585C969: BeeeOn::PocoAbstractDao::execute(Poco::Data::Statement&) (PocoAbstractDao.cpp:93)
==3366==

Signed-off-by: Jan Viktorin <3eab6ac54c005c4408f608556a6663b7f2abede7@fit.vutbr.cz>

BeeeOn/server,BeeeOn/server,BeeeOn/server,BeeeOn/server