xen-troops / displ_be

GNU General Public License v2.0
2 stars 8 forks source link

DisplayFrontendHandler::onBind() may throw an exception #104

Closed iusyk closed 4 years ago

iusyk commented 4 years ago

according to the code of base class , FrontendHandlerBase does not expect any exceptions, but, potentially, DisplayFrontendHandler::onBind may throw the exception if

  1. ctor of BuffersStorage throws an exception (now it may be just a bad_alloc, but who knows how code will be changed)
  2. DisplayFrontendHandler::createConnector can be source of invalid_argument, because there is a call of getXenStore().readInt inside of the function. readInt uses stoi and stoi can throws the exception if string is invalid.
  3. DisplayFrontendHandler::createConnector - the following call , potentially, my be the source of the exception CtrlRingBufferPtr ctrlRingBuffer( new CtrlRingBuffer(mDisplay, connector, bufferStorage, eventRingBuffer, getDomId(), port, ref));
iusyk commented 4 years ago

fix https://github.com/xen-troops/displ_be/pull/121

iusyk commented 4 years ago

The result of the final investigation At the end of the end , the event is fired from XenStore::watchesThread, the function expects that event nay throw the exception Summary: no needs to handle it inside the event. Issue can be closed.