]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Document date override flags and add sanity checks. Based on patch
authorRobert Millan <rmh@aybabtu.com>
Sun, 8 Nov 2009 22:53:42 +0000 (22:53 +0000)
committerRobert Millan <rmh@aybabtu.com>
Sun, 8 Nov 2009 22:53:42 +0000 (22:53 +0000)
sent by Andrew Cady to Debian BTS:

  http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=31;filename=date_override_doc.diff;att=1;bug=498151

util/mkisofs/mkisofs.c

index b052d10ef19b4f800f4e6cdaabb290049ab26242..0eb9d95fb3c2d721ff207b46686001a75a65b46d 100644 (file)
@@ -871,21 +871,37 @@ int FDECL2(main, int, argc, char **, argv){
        split_SL_field = 0;
        break;
       case OPTION_CREAT_DATE:
+       if (strlen (optarg) != 16) {
+         fprintf (stderr, "date string must be 16 characters.\n");
+         exit (1);
+       }
        if (creation_date)
          free(creation_date);
        creation_date = strdup(optarg);
        break;
       case OPTION_MODIF_DATE:
+       if (strlen (optarg) != 16) {
+         fprintf (stderr, "date string must be 16 characters.\n");
+         exit (1);
+       }
        if (modification_date)
          free(modification_date);
        modification_date = strdup(optarg);
        break;
       case OPTION_EXPIR_DATE:
+       if (strlen (optarg) != 16) {
+         fprintf (stderr, "date string must be 16 characters.\n");
+         exit (1);
+       }
        if (expiration_date)
          free(expiration_date);
        expiration_date = strdup(optarg);
        break;
       case OPTION_EFFEC_DATE:
+       if (strlen (optarg) != 16) {
+         fprintf (stderr, "date string must be 16 characters.\n");
+         exit (1);
+       }
        if (effective_date)
          free(effective_date);
        effective_date = strdup(optarg);