Date: Mon, 7 Oct 2002 13:21:40 -0700 (PDT) From: Brian Feldman <green@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 18877 for review Message-ID: <200210072021.g97KLeWX044851@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=18877 Change 18877 by green@green_laptop_2 on 2002/10/07 13:20:39 Correct crashes related to not knowing what the correct minimum argc is. Affected files ... .. //depot/projects/trustedbsd/mac/usr.sbin/extattr/rmextattr.c#4 edit Differences ... ==== //depot/projects/trustedbsd/mac/usr.sbin/extattr/rmextattr.c#4 (text+ko) ==== @@ -102,7 +102,8 @@ char *buf, *visbuf, *p; const char *options, *attrname; - int buflen, visbuflen, ch, error, i, arg_counter, attrnamespace; + int buflen, visbuflen, ch, error, i, arg_counter, attrnamespace, + minargc; int flag_force = 0; int flag_quiet = 0; @@ -118,15 +119,19 @@ if (!strcmp(p, "getextattr")) { what = EAGET; options = "fqsx"; + minargc = 3; } else if (!strcmp(p, "setextattr")) { what = EASET; options = "fq"; + minargc = 4; } else if (!strcmp(p, "rmextattr")) { what = EARM; options = "fq"; + minargc = 3; } else if (!strcmp(p, "lsextattr")) { what = EALS; options = "fq"; + minargc = 2; } else { usage(); } @@ -154,7 +159,7 @@ argc -= optind; argv += optind; - if (argc < 2) + if (argc < minargc) usage(); error = extattr_string_to_namespace(argv[0], &attrnamespace); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210072021.g97KLeWX044851>