1 Answers

What is he testing at this point?

Asked by: 97 views , , , , , ,
412-79

Kyle is performing the final testing of an application he developed for the accounting department.

His last round of testing is to ensure that the program is as secure as possible. Kyle runs the following command. What is he testing at this point?


#include <stdio.h>

#include <string.h>

int main(int argc, char *argv[])

{

char buffer[10];

if (argc < 2)

{

fprintf(stderr, "USAGE: %s string\n", argv[0]);

return 1;

}

strcpy(buffer, argv[1]);

return 0;

}

A.
Buffer overflow

B.
Format string bug

C.
Kernal injection

D.
SQL injection

1 Answers



  1. teramin on Oct 06, 2012 Reply

    Answers: A
    _ Buffer overflow

    Explanation:
    Answer A is the correct answer. The internal buffer is defined as a character string of 10 characters. A character string is passed as an argument. If the character string passed to the subroutine is longer than 10 characters, the buffer will overflow and parts of the stack will be overwritten.

    0 Votes Thumb up 0 Votes Thumb down 0 Votes