nerdexam
CompTIA

CAS-003 · Question #821

A major OS vendor implements an IDE-integrated tool that alerts developers on the use of insecure and deprecated С code functions. Using which of the following functions would yield an alert to the…

The correct answer is D. strcpy. strcpy() is a classic unsafe C standard library function that copies a string from a source buffer to a destination buffer with no bounds checking. This makes it trivially exploitable for buffer overflow attacks - if the source string is longer than the destination buffer…

Research, Development and Collaboration

Question

A major OS vendor implements an IDE-integrated tool that alerts developers on the use of insecure and deprecated С code functions. Using which of the following functions would yield an alert to the developer?

Options

  • Achar
  • Berrno_t
  • Cstrcat_s
  • Dstrcpy

How the community answered

(39 responses)
  • A
    3% (1)
  • B
    3% (1)
  • C
    8% (3)
  • D
    87% (34)

Explanation

strcpy() is a classic unsafe C standard library function that copies a string from a source buffer to a destination buffer with no bounds checking. This makes it trivially exploitable for buffer overflow attacks - if the source string is longer than the destination buffer, memory beyond the buffer is overwritten, potentially corrupting data, crashing the application, or enabling arbitrary code execution. Modern security-aware development tools and IDEs flag strcpy() (along with gets(), sprintf(), strcat(), etc.) as insecure and deprecated, recommending safe alternatives. strcat_s() (C) is the bounds-checked safe version of strcat and would not trigger an alert. errno_t (B) is a return type used by safe CRT functions, not a vulnerable function. char (A) is a fundamental data type, not a function at all.

Topics

#secure coding#deprecated C functions#buffer overflow#static analysis

Community Discussion

No community discussion yet for this question.

Full CAS-003 Practice