fedora 24
integer weakness #17

2

Weakness Breakdown


Definition:

An integer overflow occurs when the answer to an arithmetic operation exceeds the maximum size of the integer type used to store it. The resulting value will appear to have wrapped around the maximum value and started again at the minimum value. This would look like a clock that represents 13:00 by pointing at 1:00. An attacker can use an integer overflow during a buffer length calculation, which results in the allocated buffer being too small to hold the data copied into it, thus causing a buffer overflow.

Warning code(s):

Unless checked, the resulting number can exceed the expected range.

File Name:

SoQt-1.5.0/src/Inventor/Qt/SoQt.cpp

Context:

The highlighted line of code below is the trigger point of this particular Fedora 24 integer weakness.

 QTimer * SoQtP::timerqueuetimer = NULL;
QTimer * SoQtP::delaytimeouttimer = NULL;
SoQtP * SoQtP::slotobj = NULL;
bool SoQtP::didcreatemainwidget = FALSE;
SoQtImageReader * SoQtP::imagereader = NULL;

// *************************************************************************

#ifdef HAVE_QT_WIN_USE_SIMPLE_TIMERS
// Qt 3.3 seems to use simple timers by default. Since simple timers
// causes idle sensors to trigger only 100 times per second, we set
// this variable to false in SoQt::init(). pederb, 2004-07-21

// The global qt_win_use_simple_timers variable is at least defined in
// Qt 3.0.5 and 3.3.1. Reading the Qt interest archive, it seems like
// it's ok for application code to modify it though.
Q_EXPORT extern bool qt_win_use_simple_timers;
#endif // HAVE_QT_WIN_USE_SIMPLE_TIMERS

static void soqt_reset_simple_timers(void)
{
#ifdef HAVE_QT_WIN_USE_SIMPLE_TIMERS
  const char * env = SoAny::si()->getenv("SOQT_USE_SIMPLE_TIMERS");
  if (env) {
    qt_win_use_simple_timers = (bool) atoi(env);
  }
  else {
    qt_win_use_simple_timers = false;
  }
#endif // HAVE_QT_WIN_USE_SIMPLE_TIMERS
}

// *************************************************************************

#define ENVVAR_NOT_INITED INT_MAX

int SoQtP::DEBUG_X11SYNC = ENVVAR_NOT_INITED;
const char * SoQtP::SOQT_XSYNC = "SOQT_XSYNC";
int SoQtP::BRIL_X11_SILENCER = ENVVAR_NOT_INITED;
int SoQtP::X11_ERRORHANDLER = ENVVAR_NOT_INITED;
const char * SoQtP::SOQT_X11_ERRORHANDLER = "SOQT_X11_ERRORHANDLER";
SoQtP_XErrorHandler * SoQtP::previous_handler = NULL;

int SoQtP::DEBUG_LISTMODULES = ENVVAR_NOT_INITED;

// these two are used to make SoQt thread safe (changing a scene graph
// from a separate thread won't make Qt go haywire).
unsigned long SoQtP::original_thread;
SoQtSignalThread * SoQtP::signalthread = NULL;
 

The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world­wide basis.