IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 31, 2018, 9:52:04 AM (8 years ago)
Author:
eugene
Message:

do not let "file" command overrun static char line[]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.data/read_vectors.c

    r40012 r40333  
    1919  }
    2020 
     21  if (strlen(argv[1]) >= 2048) {
     22    gprint (GP_ERR, "filename %s is too long\n", argv[1]);
     23    return (FALSE);
     24  }
     25
    2126  strcpy (filename, argv[1]);
    2227  if (f != (FILE *) NULL) { fclose (f); }
    2328  f = fopen (filename, "r");
    2429  if (f == (FILE *) NULL) {
    25     gprint (GP_ERR, "failed to open file %s\n", argv[1]);
     30    gprint (GP_ERR, "failed to open file %s\n", filename);
    2631    return (FALSE);
    2732  }
Note: See TracChangeset for help on using the changeset viewer.