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#ccccFF
char *env;
char *copy_of_env;

if ((env = getenv("TEST_ENV")) != NULL) {
   copy_of_env = malloc(strlen(env) + 1);

   if (copy_of_env != NULL) {
      strcpy(copy_of_env, env);
   }
   else {
      /* Error handling */
   }

   copy_of_env[0] = 'a';
}

...

Rule

Severity 

Likelihood 

Remediation Cost

Priority

Level

ENV30-C

1 (low)

1 (unlikely)

3 (low)

P3

L3

Related Vulnerabilities

Search for vulnerabilities resulting from the violation of this rule on the CERT website.

References

Wiki Markup
\[[ISO/IEC 9899-1999:TC2|AA. C References#ISO/IEC 9899-1999TC2]\] Section 7.20.4.5, "The {{getenv}} function"
\[[Open Group 04|AA. C References#Open Group 04]\] [getenv|http://www.opengroup.org/onlinepubs/000095399/functions/getenv.html]