Examples of errors detected by the V614 diagnostic.


V614. Uninitialized variable 'Foo' used.


Trans-Proteomic Pipeline

V614 Uninitialized variable 'fval' used. tpplib mixturemodel.cxx 834


void MixtureModel::assessPeptideProperties(char* filename,
                               Boolean icat, Boolean glyc)
{
  ...
  double fval;
  ...
  // fval is not used
  ...
  if(! icat && strstr(pep, "C") != NULL && fval >= min_fval) {
  ...
}

Trans-Proteomic Pipeline

V614 Uninitialized variable 'iSeqSize' used. xtandem mscore_c.cpp 552


double mscore_c::dot_hr(unsigned long *_v)
{
  ...
  int iSeqSize;
  //perform a single pass through each array.
  //check every point in m_pfSeq,
  //but don't revisit positions in m_vmiType
  for (int a = 0; a < iSeqSize; a++) {
  ...
}

Similar errors can be found in some other places:

  • V614 Uninitialized variable 'separator' used. pwiz sampledatum.hpp 95
  • V614 Uninitialized variable 'close' used. pwiz sampledatum.hpp 96
  • V614 Uninitialized variable 'threshold' used. pwiz spectrumlistfactory.cpp 497
  • And 3 additional diagnostic messages.

IPP Samples

V614 Potentially uninitialized pointer 'pDirEntry' used. Consider checking the first actual argument of the 'vm_dir_close' function. loadcodec.c 287


Ipp32s GetUSCCodecParamsByFormat(
  LoadedCodec *codec, Ipp32s lQuery,FILE *f_log)
{
   ....
   vm_dir *pDirEntry;
   ....
   if(codec->pSOHandle==NULL) {
      ....
      st = vm_dir_open(&pDirEntry,SO_FILE_MASK);
      ....
   }
   ....
   vm_dir_close(pDirEntry);
   return -1;
}

MPC-HC

V614 Potentially uninitialized variable 'rtRefClockTimeNow' used. syncrenderer.cpp 3604


void CSyncAP::RenderThread()
{
  ....
  REFERENCE_TIME rtRefClockTimeNow;
  if (m_pRefClock) {
    m_pRefClock->GetTime(&rtRefClockTimeNow);
  }
  LONG lLastVsyncTime =
    (LONG)((m_llEstVBlankTime - rtRefClockTimeNow) / 10000);
  ....
}

ReactOS

V614 Uninitialized pointer 'hKey' used. Consider checking the first actual argument of the 'RegCreateKeyExW' function. tcpipconf_notify.c 3138


HRESULT WINAPI
INetCfgComponentControl_fnApplyRegistryChanges(
  INetCfgComponentControl * iface)
{
  HKEY hKey;
  ....
  if (RegCreateKeyExW(hKey,
      L"SYSTEM\\CurrentControlSet....",
      ....) == ERROR_SUCCESS)
    ....
}

NetXMS

V614 Potentially uninitialized variable 'nSqlRet' used. odbcsapi.cpp 220


int OdbcDisconnect(void* pvSqlCtx)
{
  ....
  SQLRETURN nSqlRet;
  ....
  if (nRet == SUCCESS)
  {
    ....
    nSqlRet = SQLDisconnect(pSqlCtx->hDbc);
    ....
  }
  if (SQLRET_FAIL(nSqlRet))
  ....
}

Similar errors can be found in some other places:

  • V614 Potentially uninitialized variable 'dwNumRows' used. session.cpp 2112
  • V614 Potentially uninitialized variable 'dwNumRows' used. session.cpp 7525
  • V614 Potentially uninitialized variable 'dwNumRows' used. session.cpp 7659
  • And 3 additional diagnostic messages.

Chromium

V614 Potentially uninitialized variable 'result' used. ie_event_sink.cc 240


HRESULT IEEventSink::Attach(IWebBrowser2* browser) {
  DCHECK(browser);
  HRESULT result;
  if (browser) {
    web_browser2_ = browser;
    FindIEProcessId();
    result = DispEventAdvise(web_browser2_,
                             &DIID_DWebBrowserEvents2);
  }
  return result;
}

Chromium

V614 Potentially uninitialized variable 'skip_dir_check' used. Consider checking the fifth actual argument of the 'Bind' function. save_package.cc 1326


void SavePackage::GetSaveInfo() {
  ....
  bool skip_dir_check;
  ....
  if (....) {
    ....->GetSaveDir(...., &skip_dir_check);
  }
  ....
  BrowserThread::PostTask(BrowserThread::FILE,
                          FROM_HERE,
                          base::Bind(..., skip_dir_check, ...));
}

Embedded SSL Library

V614 Potentially uninitialized variable 'rhSize' used. sniffer.c 2255


static int ProcessMessage(....)
{
  int rhSize;
  ....
  notEnough = 0;
  ....
  if (sslBytes >= RECORD_HEADER_SZ) {
    if (GetRecordHeader(sslFrame, &rh, &rhSize) != 0) {
      ....
      return -1;
    }
  }
  else
    notEnough = 1;
  ....
  if (notEnough || rhSize > (sslBytes - RECORD_HEADER_SZ)) {
    ....
  }

  tmp = sslFrame + rhSize;   // <=
  ....
}

Trans-Proteomic Pipeline

V614 Potentially uninitialized pointer 'pScanIndex' used. sqt2xml.cxx 476


int main(int argc, char** argv) {
  ....
  ramp_fileoffset_t *pScanIndex;
  ....
  if ( (pFI=rampOpenFile(mzXmlPath_.c_str()))==NULL) {
    ....
  } else {
    ....
    pScanIndex = readIndex(pFI, indexOffset,
                           &iAnalysisLastScan );
    ....
  }
  ....
  if (pScanIndex != NULL)
    free(pScanIndex);

  return 0;
}

Similar errors can be found in some other places:

  • V614 Potentially uninitialized pointer 'fp_' used. Consider checking the second actual argument of the 'PRINT_DATA' function. dta-xml.cpp 307

OpenCOLLADA

V614 Uninitialized variable 'i' used. mayadmtypes.h 1728


void write(FILE* file) const
{
  fprintf(file,"%i %i %i %i ",
    sDivisionCount, tDivisionCount, uDivisionCount, pointCount);
  size_t size = pointCount*3;
  for(size_t i; i<size; ++i)
  {
    fprintf(file, "%f", points[i]);
    if(i+1<size) fprintf(file, " ");
  }
}

Apache HTTP Server

V614 Potentially uninitialized pointer 'wch' used. apr start.c 58


static int warrsztoastr(const char * const * *retarr,
                        const wchar_t * arrsz, int args)
{
  const apr_wchar_t *wch;
  ....

  if (args < 0) {
    for (args = 1, wch = arrsz; wch[0] || wch[1]; ++wch)
      if (!*wch)
       ++args;
  }
  wsize = 1 + wch - arrsz;
  ....
}

Geant4 software

V614 Potentially uninitialized iterator 'insert_index' used. g4excitedstring.hh 193


typedef std::vector<G4Parton *> G4PartonVector;

inline
void G4ExcitedString::InsertParton(
  G4Parton *aParton, const G4Parton * addafter)
{
  G4PartonVector::iterator insert_index;
  ....
  if ( addafter != NULL )
  {
    insert_index=std::find(thePartons.begin(),
                           thePartons.end(), addafter);
    ....
  }
  thePartons.insert(insert_index+1, aParton);
}

GNU C Library

V614 Uninitialized variable 'resplen' used. res_send.c 790


static int send_vc(....)
{
  ....
  int truncating, connreset, resplen, n;
  ....
  #ifdef _STRING_ARCH_unaligned
    *anssizp2 = orig_anssizp - resplen;
    *ansp2 = *ansp + resplen;
  #else
  ....
}

Firebird

V614 Uninitialized variable 'sdl_operator' used. sdl.cpp 404


static const UCHAR* compile(const UCHAR* sdl, sdl_arg* arg)
{
  SLONG n, count, variable, value, sdl_operator;
  ....
  switch (op)
  {
    ....
    case isc_sdl_add:
      sdl_operator = op_add;
    case isc_sdl_subtract:
      if (!sdl_operator)
        sdl_operator = op_subtract;
  ......
}

Firebird

V614 Potentially uninitialized pointer 'fieldNode' used. blb.cpp 1043


void blb::move(....)
{
  ....
  const FieldNode* fieldNode;
  if (field)
  {
    if ((fieldNode = ExprNode::as<FieldNode>(field)))
    ....
  }
  ....
  const USHORT id = fieldNode->fieldId;
  ....
}

FFmpeg

V614 Potentially uninitialized variable 'info_bits' used. g723_1.c 2335


static int pack_bitstream(G723_1_Context *p,
  unsigned char *frame, int size)
{
  ....
  int info_bits;
  ....
  if (p->cur_rate == RATE_6300) {
    info_bits = 0;
    put_bits(&pb, 2, info_bits);
  }
  ....
  return frame_size[info_bits];
}

Scilab

V614 Potentially uninitialized pointer 'loc' used. getfunctionbyname.c 61


typedef void (*voidf)();

voidf GetFunctionByName (char *name, int *rep, FTAB *table)
{
  void (*loc)();
  if (name)
  {
    ....
    loc = Emptyfunc;
    ....
  }
  else
  {
    ....
  }
  return(loc);
}

Word for Windows 1.1a

V614 Uninitialized pointer 'pfl' used. Consider checking the first actual argument of the 'fclose' function. eldes.c 87


main(argc, argv)
int argc;
char * argv [];
{
  FILE * pfl;
  ....
  for (argi = 1; argi < argc; ++argi)
  {
    if (FWild(argv[argi]))
    {
      FEnumWild(argv[argi], FEWild, 0);
    }
    else
    {
      FEWild(argv[argi], 0);
    }

    fclose(pfl);
  }
  ....
}

Word for Windows 1.1a

V614 Uninitialized pointer 'rgsz0' used. Consider checking the first actual argument of the 'strcpy' function. makeopus.c 961


FPathSpawn( rgsz )
char *rgsz[];
{ /* puts the correct path at the beginning of rgsz[0]
     and calls FSpawnRgsz */
  char *rgsz0;

  strcpy(rgsz0, szToolsDir);
  strcat(rgsz0, "\\");
  strcat(rgsz0, rgsz[0]);
  return FSpawnRgsz(rgsz0, rgsz);
}

OGDF

V614 Potentially uninitialized pointer 'layout' used. ogdf ogmlparser.cpp 2337


bool OgmlParser::buildAttributedClusterGraph(....)
{
  ....
  XmlTagObject* layout;
  if (structure->m_pBrother != NULL) {
    layout = structure->m_pBrother;
  }
  if ((layout) &&
      (layout->getName() == Ogml::s_tagNames[Ogml::t_layout]))
  ....
}

APR

V614 Potentially uninitialized pointer 'wch' used. libapr start.c 58


static int warrsztoastr(const char * const * *retarr,
                        const wchar_t * arrsz, int args)
{
  const apr_wchar_t *wch;
  ....
  if (args < 0) {
    for (args = 1, wch = arrsz; wch[0] || wch[1]; ++wch)
      if (!*wch)
        ++args;
  }
  wsize = 1 + wch - arrsz;
  ....
}

Mozilla Firefox

V614 Potentially uninitialized pointer 'device' used. nptest_windows.cpp 164


static ID3D10Device1*
getD3D10Device()
{
  ID3D10Device1 *device;
  ....
  if (createDXGIFactory1)
  {
    ....
    hr = createD3DDevice(...., &device);
    ....
  }
  return device;
}

Oracle VM Virtual Box

V614 Potentially uninitialized variable 'rc' used. suplib-win.cpp 367


static int suplibOsStopService(void)
{
  /* Assume it didn't exist, so we'll create the service. */
  int  rc;
  SC_HANDLE  hSMgr = OpenSCManager(....);
  ....
  if (hSMgr)
  {
    ....
    rc = VINF_SUCCESS;
    ....
  }
  return rc;
}

Similar errors can be found in some other places:

  • V614 Potentially uninitialized variable 'rc' used. suplib-win.cpp 416

Miranda NG

V614 Potentially uninitialized pointer 'url' used. IEView ieview.cpp 1117


BSTR IEView::getHrefFromAnchor(IHTMLElement *element)
{
  ....
  if (SUCCEEDED(....) {
    VARIANT variant;
    BSTR url;
    if (SUCCEEDED(element->getAttribute(L"href", 2, &variant) &&
        variant.vt == VT_BSTR))
    {
      url = mir_tstrdup(variant.bstrVal);
      SysFreeString(variant.bstrVal);
    }
    pAnchor->Release();
    return url;
  }
  ....
}

Similar errors can be found in some other places:

  • V614 Potentially uninitialized pointer 'hTimeZone' used. Consider checking the second actual argument of the 'Template_MakeRelativeDate' function. TabSRMM msglog.cpp 799
  • V614 Potentially uninitialized pointer 'tSet' used. TabSRMM templates.cpp 221
  • V614 Potentially uninitialized pointer 'szLast' used. Consider checking the first actual argument of the 'null_strdup' function. ICQ icq_servlist.cpp 1714
  • And 17 additional diagnostic messages.

Godot Engine

V614 Potentially uninitialized pointer 'name' used. cp_player_data_control.cpp 244


const char* CPPlayer::get_voice_sample_name(int p_voice)
{
  const char *name;
  if (!voice[p_voice].sample_ptr)
    name=voice[p_voice].sample_ptr->get_name();
  return name;
}

Similar errors can be found in some other places:

  • V614 Potentially uninitialized pointer 'name' used. cp_player_data_control.cpp 313

Doxygen

V614 Potentially uninitialized pointer 't' used. vhdlparser.cc 4127


QCString VhdlParser::extended_identifier()
{
  Token *t;
  if (!hasError)
    t = jj_consume_token(EXTENDED_CHARACTER);
  return t->image.c_str();
  assert(false);
}

Similar errors can be found in some other places:

  • V614 Potentially uninitialized pointer 'tmpEntry' used. vhdlparser.cc 4451
  • V614 Potentially uninitialized pointer 't' used. vhdlparser.cc 5304

Mozilla Thunderbird

V614 Potentially uninitialized pointer 'hOldFont' used. progressui_win.cpp 168


static void InitDialog(....)
{
  ....
  HFONT hInfoFont, hOldFont;
  hInfoFont = (HFONT)SendMessage(hWndInfo, WM_GETFONT, 0, 0);

  if (hInfoFont)
    hOldFont = (HFONT)SelectObject(hDCInfo, hInfoFont);
  ....
  if (hOldFont)
    SelectObject(hDCInfo, hOldFont);
  ....
}

Similar errors can be found in some other places:

  • V614 Potentially uninitialized pointer 'queryD3DKMTStatistics' used. gfxwindowsplatform.cpp 206

OpenToonz

V614 Potentially uninitialized pointer 'socket' used. Consider checking the first actual argument of the 'connect' function. tmsgcore.cpp 36


void TMsgCore::OnNewConnection() //server side
{
  QTcpSocket *socket;
  if (m_tcpServer)                                 // <=
    socket = m_tcpServer->nextPendingConnection(); // <=
  assert(socket);

  bool ret = connect(socket, ....);                // <=
  ret = ret && connect(socket, ....);              // <=
  assert(ret);
  m_sockets.insert(socket);
}

OpenToonz

V614 Uninitialized iterator 'it1' used. fxcommand.cpp 2096


QString DeleteLinksUndo::getHistoryString()
{
  ....
  std::list<TFxP>::const_iterator it1; // <=
  std::list<TFx *>::const_iterator ft;
  for (ft = m_terminalFxs.begin(); ft != ....end(); ++ft) {
    if (ft != m_terminalFxs.begin())
      str += QString(",  ");
    str += QString("%1- -Xsheet")
          .arg(QString::fromStdWString((*it1)->getName())); // <=
  }
  ....
}

ReactOS

V614 Potentially uninitialized pointer 'pptr' used. Consider checking the first actual argument of the 'check_hierarchical' function. uri.c 6838


static HRESULT parse_canonicalize(....)
{
  const WCHAR **pptr;
  ....
  if(uri->scheme_start > -1 && uri->path_start > -1) {
    ptr = uri->canon_uri+uri->scheme_start+uri->scheme_len+1;
    pptr = &ptr;
  }
  reduce_path = !(flags & URL_DONT_SIMPLIFY) &&
                  ptr && check_hierarchical(pptr);
}

Similar errors can be found in some other places:

  • V614 Potentially uninitialized pointer 'name' used. Consider checking the third actual argument of the 'disp_get_id' function. engine.c 928
  • V614 Potentially uninitialized pointer 'name_str' used. Consider checking the first actual argument of the 'jsstr_release' function. engine.c 929
  • V614 Potentially uninitialized pointer 'FileHandle' used. Consider checking the first actual argument of the 'CloseHandle' function. dosfiles.c 402
  • And 3 additional diagnostic messages.

CPython

V614 Potentially uninitialized pointer 'sigint_event' used. semaphore.c 120


static PyObject *
semlock_acquire(SemLockObject *self,
                PyObject *args,
                PyObject *kwds)
{
  ....
  HANDLE handles[2], sigint_event;
  ....
  /* prepare list of handles */
  nhandles = 0;
  handles[nhandles++] = self->handle;
  if (_PyOS_IsMainThread()) {
    sigint_event = _PyOS_SigintEvent();
    assert(sigint_event != NULL);
    handles[nhandles++] = sigint_event;
  }

  /* do the wait */
  Py_BEGIN_ALLOW_THREADS
  if (sigint_event != NULL) //<=
    ResetEvent(sigint_event);
  ....
}

FreeBSD Kernel

V614 Uninitialized variable 'status' used. tdioctl.c 3396


osGLOBAL bit32
tdsaSendTMFIoctl(
      tiRoot_t             *tiRoot,
      tiIOCTLPayload_t     *agIOCTLPayload,
      void                 *agParam1,
      void                 *agParam2,
      unsigned long        resetType
    )
{
  bit32    status;
  tmf_pass_through_req_t  *tmf_req = ....;
#if !(defined(__FreeBSD__))
  status = ostiSendResetDeviceIoctl(tiRoot, agParam2,
    tmf_req->pathId, tmf_req->targetId, tmf_req->lun, resetType);
#endif
  TI_DBG3((
    "Status returned from ostiSendResetDeviceIoctl is %d\n",
    status));
  if(status != IOCTL_CALL_SUCCESS)
  {
    agIOCTLPayload->Status = status;
    return status;
  }
  status = IOCTL_CALL_SUCCESS;
  return status;
}

TensorFlow

V614 Potentially uninitialized variable 'sparse_input_start' used. sample_inputs_op.cc 351


void Compute(OpKernelContext* context) override {
  ....
  int64 sparse_input_start;                               // <=
  ....
  if (sparse_input) {
    num_total_features += GetNumSparseFeatures(
      sparse_input_indices, *it, &sparse_input_start);    // <=
  }
  if (num_total_features == 0) {
    LOG(WARNING) << "num total features is zero.";
    break;
  }
  if (rand_feature < input_spec_.dense_features_size()) {
    ....
  } else {
    ....
    const int32 sparse_index = sparse_input_start +       // <=
      rand_feature - input_spec_.dense_features_size();
    ....
  }
  ....
}

EFL Core Libraries

V614 Uninitialized variable 'temp' used. Consider checking the first actual argument of the 'gmtime' function. elm_calendar.c 720


extern struct tm *gmtime (const time_t *__timer)
  __attribute__ ((__nothrow__ , __leaf__));

static void
_set_headers(Evas_Object *obj)
{
  static char part[] = "ch_0.text";
  int i;
  struct tm *t;
  time_t temp;
  ELM_CALENDAR_DATA_GET(obj, sd);

  elm_layout_freeze(obj);

  sd->filling = EINA_TRUE;

  t = gmtime(&temp;);
  ....
}


Do you make errors in the code?

Check your code
with PVS-Studio

Static code analysis
for C, C++ and C#

goto PVS-Studio;