Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Edited by sciSpider (sch jbop) (X_X)@==(Q_Q)@

...

Code Block
bgColor#FFCCCC
int main(int argc, char const char *argv[]) {
  char *buff;

  buff = (char *)malloc(BUFSIZE);
  if (!buff) {
     /* handle error condition */
  }
  /* ... */
  free(buff);
  /* ... */
  strncpy(buff, argv[1], BUFSIZE-1);
}

...

Code Block
bgColor#ccccff
int main(int argc, char const char *argv[]) {
  char *buff;

  buff = (char *)malloc(BUFSIZE);
  if (!buff) {
     /* handle error condition */
  }
  /* ... */
  strncpy(buff, argv[1], BUFSIZE-1);
  /* ... */
  free(buff);
}

...

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

MEM30-C

3 ( high ) 3 (

likely )

2 ( medium )

P18

L1

Automated Detection

The LDRA tool suite V 7.6.0 is able to detect violations of this rule.

...