thieumao

Analyze this source

Jun 5th, 2013
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.41 KB | None | 0 0
  1. // Analyze this source code and specify the flaw of this source code?
  2.  
  3. #include <stdlib.h>
  4. #include <stdio.h>
  5. #include <string.h>
  6.  
  7. int main(int argc, char **argv){
  8.     char command[256];
  9.     if (argc != 2){
  10.         printf("Eroror: Please enter a program to time!\n");
  11.         return -1;
  12.     }
  13.     memset(&command, 0, sizeof(command));
  14.     strcat(command, "time ./");
  15.     strcat(command, "argv[1]");
  16.     system(command);
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment