Back to success stories

Sample of Defect

Project Name CID Checker Category Developer Description
Kodi 1270825 OVERRUN Memory - corruptions Impacts a highly used used area of our code which could cause problems when running for extended time. Coverity scan helps our developers finding issues like these. Although i'm only the project manager and no developer, I sure do appreciate these scan results as it helps us to improve our software.
File: /xbmc/addons/AddonCallbacksGUI.cpp
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
    dateTime = systemTime;
    dateTime.GetAsTm(time);
    return true;
  }
  return false;
}

bool CAddonCallbacksGUI::Dialog_Numeric_ShowAndGetDate(tm &date, const char *strHeading)
{
  SYSTEMTIME systemTime;
  CDateTime dateTime(date);
  dateTime.GetAsSystemTime(systemTime);
  if (CGUIDialogNumeric::ShowAndGetDate(systemTime, strHeading))
  {
    dateTime = systemTime;
    dateTime.GetAsTm(date);
    return true;
  }
  return false;
}

bool CAddonCallbacksGUI::Dialog_Numeric_ShowAndGetIPAddress(char &strIPAddress, unsigned int iMaxStringSize, const char *strHeading)
{
  std::string strIP = &strIPAddress;
 <<< CID 1270825: Memory - corruptions OVERRUN
 <<< 1. Overrunning struct type _ZSt6string of 8 bytes by passing it to a function which accesses it at byte offset 15.
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
  bool bRet = CGUIDialogNumeric::ShowAndGetIPAddress(strIP, strHeading);
  if (bRet)
    strncpy(&strIPAddress, strIP.c_str(), iMaxStringSize);
  return bRet;
}

bool CAddonCallbacksGUI::Dialog_Numeric_ShowAndGetNumber(char &strInput, unsigned int iMaxStringSize, const char *strHeading, unsigned int iAutoCloseTimeoutMs)
{
  std::string str = &strInput;
  bool bRet = CGUIDialogNumeric::ShowAndGetNumber(str, strHeading, iAutoCloseTimeoutMs);
  if (bRet)
    strncpy(&strInput, str.c_str(), iMaxStringSize);
  return bRet;
}

bool CAddonCallbacksGUI::Dialog_Numeric_ShowAndGetSeconds(char &timeString, unsigned int iMaxStringSize, const char *strHeading)
{
  std::string str = &timeString;
  bool bRet = CGUIDialogNumeric::ShowAndGetSeconds(str, strHeading);
  if (bRet)
    strncpy(&timeString, str.c_str(), iMaxStringSize);
  return bRet;
}
//@}

/*! @name GUI File browser functions */
//@{
Events:
1. overrun-buffer-val AddonCallbacksGUI.cpp:1812