Unicorn with delicious cookie
Nous utilisons des cookies pour améliorer votre expérience de navigation. En savoir plus
Accepter
to the top
>
>
>
Examples of errors detected by the V541…

Examples of errors detected by the V541 diagnostic

V541. String is printed into itself. Consider inspecting the expression.


PCSX2

V541 It is dangerous to print the string 'fileData' into itself. pcsx2 patchbrowser.cpp 211


void ListPatches (HWND hW) {
  ....
  while((tmpi=fgetc(fp)) != EOF)
    sprintf(fileData,"%s%c",fileData,tmpi);
  ....
  sprintf(tmpStr,"%s (%s)",tmpStr,FindData.cFileName);
  ....
}

The code might work, but this is a dangerous game.

Similar errors can be found in some other places:

  • V541 It is dangerous to print the string 'tmpStr' into itself. pcsx2 patchbrowser.cpp 239

CAMEL

V541 It is dangerous to print the string 'szOperatingSystem' into itself. stickies camel.cpp 572


char * OSDetection ()
{
  ....
  sprintf (szOperatingSystem, "%sversion %d.%d %s (Build %d)",
           szOperatingSystem,
           osvi.dwMajorVersion,
           osvi.dwMinorVersion,
           osvi.szCSDVersion,
           osvi.dwBuildNumber & 0xFFFF);
  ....
  sprintf (szOperatingSystem, "%s%s(Build %d)",
           szOperatingSystem, osvi.szCSDVersion,
           osvi.dwBuildNumber & 0xFFFF);
  ....
}

The code might work, but this is a dangerous game.

Similar errors can be found in some other places:

  • V541 It is dangerous to print the string 'szOperatingSystem' into itself. stickies camel.cpp 603

Mozilla Firefox

V541 It is dangerous to print the string 'newhost' into itself. ssltunnel.cpp 531


bool AdjustWebSocketHost(relayBuffer& buffer,
                         connection_info_t *ci)
{
  ....
  sprintf(newhost, "%s:%d", newhost,
          PR_ntohs(inet_addr.inet.port));
  ....
}

The code might work, but this is a dangerous game.


UCSniff

V541 It is dangerous to print the string 'dst' into itself. vc_format.c 177


int hex_format(...., u_char *dst)
{
  ....
  sprintf(dst, "%s %04x: ", dst, i );
  ....
}

The code might work, but this is a dangerous game.

Similar errors can be found in some other places:

  • V541 It is dangerous to print the string 'dst' into itself. vc_format.c 183
  • V541 It is dangerous to print the string 'dst' into itself. vc_format.c 185
  • V541 It is dangerous to print the string 'dst' into itself. vc_format.c 200

TinyCAD

V541 It is dangerous to print the string 'csText' into itself. childfrm.cpp 79


void CChildFrame::OnUpdateFrameTitle(BOOL bAddToTitle)
{
  ....
  CString csText;
  ....
  if (m_nWindow > 0)
    csText.Format(_T("%s: %d"), csText, m_nWindow);
  ....
}

Scilab

V541 It is dangerous to print the string 'lines' into itself. sci_toprint.cpp 314


static int sci_toprint_two_rhs(void* _pvCtx,
                               const char *fname)
{
  ....
  sprintf(lines, "%s%s\n", lines, pStVarOne[i]);
  ....
}

Similar errors can be found in some other places:

  • V541 It is dangerous to print the string 'coserr.buf' into itself. sci_coserror.c 94

FreeBSD Kernel

V541 It is dangerous to print the string 'buffer' into itself. ata-highpoint.c 102


static int
ata_highpoint_probe(device_t dev)
{
  ....
  char buffer[64];
  ....
  strcpy(buffer, "HighPoint ");
  strcat(buffer, idx->text);
  if (idx->cfg1 == HPT_374) {
  if (pci_get_function(dev) == 0)
      strcat(buffer, " (channel 0+1)");
  if (pci_get_function(dev) == 1)
      strcat(buffer, " (channel 2+3)");
  }
  sprintf(buffer, "%s %s controller",
    buffer, ata_mode2str(idx->max_dma));
  ....
}

Similar errors can be found in some other places:

  • V541 It is dangerous to print the string 'buffer' into itself. ata-promise.c 208

Serious Engine 1 v.1.10

V541 It is dangerous to print the string 'achrDefaultScript' into itself. dlgcreateanimatedtexture.cpp 359


BOOL CDlgCreateAnimatedTexture::OnInitDialog()
{
  ....
  // allocate 16k for script
  char achrDefaultScript[ 16384];
  // default script into edit control
  sprintf( achrDefaultScript, ....); // <=
  ....
  // add finishing part of script
  sprintf( achrDefaultScript,        // <=
           "%sANIM_END\r\nEND\r\n",  // <=
           achrDefaultScript);       // <=
  ....
}

Ardour

V541 It is dangerous to print the 'buf' string into itself. luawindow.cc 490


void
LuaWindow::save_script ()
{
  ....
  do {
    char buf[80];
    time_t t = time(0);
    struct tm * timeinfo = localtime (&t);
    strftime (buf, sizeof(buf), "%s%d", timeinfo);
    sprintf (buf, "%s%ld", buf, random ());
  ....
}

close form

Remplissez le formulaire ci‑dessous en 2 étapes simples :

Vos coordonnées :

Étape 1
Félicitations ! Voici votre code promo !

Type de licence souhaité :

Étape 2
Team license
Enterprise licence
** En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité
close form
Demandez des tarifs
Nouvelle licence
Renouvellement de licence
--Sélectionnez la devise--
USD
EUR
* En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité

close form
La licence PVS‑Studio gratuit pour les spécialistes Microsoft MVP
close form
Pour obtenir la licence de votre projet open source, s’il vous plait rempliez ce formulaire
* En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité

close form
I want to join the test
* En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité

close form
check circle
Votre message a été envoyé.

Nous vous répondrons à


Si l'e-mail n'apparaît pas dans votre boîte de réception, recherchez-le dans l'un des dossiers suivants:

  • Promotion
  • Notifications
  • Spam