• recategorized by
540 views
1 1 vote

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

Please log in or register to answer this question.

Answer:
Position:
Show:

Related questions

0 0 votes
0 0 answers
399
399 views
admin asked Jan 5, 2019
399 views
Consider the following implementation as a solution to the critical section problem for two processes $\text{P}_{0}$ and $\text{P}_{1}$ with id $0$ and $1,$ respectively....
0 0 votes
0 0 answers
474
474 views
admin asked Jan 5, 2019
474 views
Consider the following code.int count = 0; void *thfunc () { int ctr = 0; for(ctr=0; ctr<100; ctr++) count++; }If thfunc is executed by two threads concurrently in a unip...
0 0 votes
0 0 answers
593
593 views
admin asked Jan 5, 2019
593 views
Consider the following statements regarding life time of any normally terminating process in an operating system.The process must be in $\text{RUNNING}$ state at least on...
0 0 votes
1 1 answer
571
571 views
admin asked Jan 5, 2019
571 views
Consider a computer system with $32-$ bit virtual addressing and page size of sixty-four kilobytes. The computer system has one-level page table per process with each pag...