Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: veriexecctl(8) segfaults when no argument is given



Actually I forgot to attach it, albeit trivial :)

Index: veriexecctl.c
===================================================================
RCS file: /cvsroot/src/sbin/veriexecctl/veriexecctl.c,v
retrieving revision 1.31
diff -u -r1.31 veriexecctl.c
--- veriexecctl.c       15 Feb 2008 15:33:56 -0000      1.31
+++ veriexecctl.c       31 Aug 2008 12:42:55 -0000
@@ -2,7 +2,7 @@

 /*-
  * Copyright 2005 Elad Efrat <elad%NetBSD.org@localhost>
- * Copyright 2005 Brett Lymn <blymn%netbsd.org@localhost>
+ * Copyright 2005 Brett Lymn <blymn%netbsd.org@localhost>
  *
  * All rights reserved.
  *
@@ -144,7 +144,7 @@
         v = dict_getd(qp, "fp");
        for (i = 0; i < prop_data_size(prop_dictionary_get(qp, "fp")); i++)
                printf("%02x", v[i] & 0xff);
-       printf("\n");
+       printf("\n");
 }

 static char *
@@ -226,6 +226,8 @@

        argc -= optind;
        argv += optind;
+        if (argc == 0)
+            usage();

        if ((gfd = open(VERIEXEC_DEVICE, O_RDWR, 0)) == -1)
                err(1, "Cannot open `%s'", VERIEXEC_DEVICE);


Home | Main Index | Thread Index | Old Index