Aliensbrain
  • Home
  • Topics
  • Quizzes
  • Notebooks
  • Community
  • Sign in
  • security Online Quiz - 10
  • ```c int main(int argc,char* argv[]) { int *ptr1=new in...
int main(int argc,char* argv[]) {
    int *ptr1=new int;
    if(ptr1==NULL)    exit(1);
    int *ptr2=new int;
    if(ptr2==NULL)    exit(1);
    char* j;
    j=argv[1];
    int k=atoi(j);
    if (j==0){
        Ptr1=&k;
        delete ptr2;  /*1*/
    }
    else {
        Ptr2=&k;
    }
    delete ptr1;  /*2*/  
    delete ptr2; /*3*/   
    return 0;
}

which line of the code should be deleted to remove vulnerability

technology security
  1. line 1 and line 3

  2. line 2 and line 3

  3. line 1

  4. line 3


Show answer
Correct Option: C

Find more quizzes:

© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy