Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178236522
D62320.1796307831.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D62320.1796307831.diff
View Options
diff --git a/usr.sbin/binmiscctl/binmiscctl.c b/usr.sbin/binmiscctl/binmiscctl.c
--- a/usr.sbin/binmiscctl/binmiscctl.c
+++ b/usr.sbin/binmiscctl/binmiscctl.c
@@ -133,7 +133,7 @@
IBE_SYSCTL_NAME_LIST
};
-static void __dead2
+static void __dead2 __printflike(1, 2)
usage(const char *format, ...)
{
va_list args;
@@ -288,10 +288,10 @@
usage("Required argument missing\n");
if (strlen(argv[0]) > IBE_NAME_MAX)
usage("'%s' string length longer than IBE_NAME_MAX (%d)",
- IBE_NAME_MAX);
+ argv[0], IBE_NAME_MAX);
strlcpy(&xbe->xbe_name[0], argv[0], IBE_NAME_MAX);
- while ((ch = getopt_long(argc, argv, "epi:m:M:o:s:", add_opts, NULL))
+ while ((ch = getopt_long(argc, argv, "+epi:m:M:o:s:", add_opts, NULL))
!= -1) {
switch(ch) {
@@ -337,6 +337,12 @@
}
}
+ argc -= optind;
+ argv += optind;
+
+ if (argc != 0)
+ usage("Error: add only takes options: %s", argv[0]);
+
if (xbe->xbe_msize == 0) {
if (NULL != magic)
free(magic);
@@ -386,7 +392,7 @@
usage("Required argument missing\n");
if (strlen(argv[0]) > IBE_NAME_MAX)
usage("'%s' string length longer than IBE_NAME_MAX (%d)",
- IBE_NAME_MAX);
+ argv[0], IBE_NAME_MAX);
strlcpy(&xbe->xbe_name[0], argv[0], IBE_NAME_MAX);
return (0);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 3, 2:23 PM (18 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42183275
Default Alt Text
D62320.1796307831.diff (1 KB)
Attached To
Mode
D62320: binmiscctl: fix a crash and argument permutation in `add`
Attached
Detach File
Event Timeline