IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 40498


Ignore:
Timestamp:
Jul 6, 2018, 1:06:27 PM (8 years ago)
Author:
eugene
Message:

do not let format overflow string size

Location:
trunk/Ohana/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/addstar/src/sky_tessalation.c

    r39457 r40498  
    815815
    816816  int i, j, N, NX, NY, Ndigit;
    817   char format[24];
     817  char format[80];
    818818
    819819  NX = input[0].NX/(double)Nx + 0.5;
     
    829829  if (Nx * Ny > 1) {
    830830    Ndigit = (int)(log10(Nx*Ny)) + 1 ;
    831     snprintf (format, 24, "%s.%%0%dd", input[0].name, Ndigit);
     831    snprintf (format, 80, "%s.%%0%dd", input[0].name, Ndigit);
    832832  } else {
    833     snprintf (format, 24, "%s", input[0].name);
     833    snprintf (format, 80, "%s", input[0].name);
    834834  }
    835835
  • trunk/Ohana/src/libdvo/src/dvo_util.c

    r39457 r40498  
    6060  }
    6161
    62   snprintf (dvoConfig->photcodeFile, 256, "%s/Photcodes.dat", dvoConfig->catdir);
     62  // photcodeFile[] must be > catdir[]
     63  snprintf (dvoConfig->photcodeFile, 280, "%s/Photcodes.dat", dvoConfig->catdir);
    6364  if (!LoadPhotcodes (dvoConfig->photcodeFile, MasterPhotcodeFile, FALSE)) {
    6465    fprintf (stderr, "error loading photcode table %s or master file %s\n",
     
    9596  }
    9697
    97   char filename[256];
     98  char filename[280];
    9899 
    99   snprintf (filename, 256, "%s/Images.dat", dvoConfig->catdir);
     100  snprintf (filename, 280, "%s/Images.dat", dvoConfig->catdir);
    100101
    101102  gfits_db_init (&dvoConfig->imageDB);
Note: See TracChangeset for help on using the changeset viewer.