recategorized by
308 views
1 votes
1 votes

Consider the C program as below. There is a problem with this program which could lead to a cyber-attack on the program:

#include<stdio.h>
#include<string.h>
#include<stdlib.h>

intmain(intargc, char*argv[])

{
        char processName[5];
        if(argc<2)

        {
                printf(“Not to be executed….\n”);
                printf(“Syntax: %s <characters>\n”,argv[0]);
                exit(0);
        }
        strcpy(processName,argv[1]);  
        printf(“The Process Name is = %s\n”,processName);
        return 0;
}

What kind of problem is it?

  1. Format String Vulnerability Problem
  2. Heap Overflow Problem
  3. Integer Overflow Problem
  4. Buffer Overflow Problem
recategorized by

Please log in or register to answer this question.

Answer:

Related questions