Question: Using the following program, at which line ( s ) of code will a buffer overflow condition occur? 1 #include 2 #define BUFFER _ SIZE

Using the following program, at which line(s) of code will a buffer overflow condition occur?
1 #include
2 #define BUFFER_SIZE 0
3 int main(int argc, char *argv[])
4{
5 int j =0;
6 char buffer[BUFFER_SIZE];
7 int k =0;
8 if (argc <2){ return -1; }
9 strcpy(buffer, argv[1]);
10 printf(K is %d, J is %d, buffer is %s
, j, k, buffer);
11 return 0;
12}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!