Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Mar 2001 17:14:48 +0900 (JST)
From:      fuyuki@jade.dti.ne.jp
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/25820: diskpart(8) causes segfaults
Message-ID:  <200103150814.f2F8EmH03055@jade.dti.ne.jp>

next in thread | raw e-mail | index | archive | help

>Number:         25820
>Category:       bin
>Synopsis:       diskpart(8) causes segfaults
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 15 00:20:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Kimura Fuyuki
>Release:        FreeBSD 4.3-BETA i386
>Organization:
>Environment:
System: FreeBSD ns.test 4.3-BETA FreeBSD 4.3-BETA #3: Wed Mar 14 13:19:42 JST 2001 root@ns.test:/sack/obj/usr/src/sys/NS i386


	
>Description:
if not given enough arguments, diskpart(8) causes segfaults.
>How-To-Repeat:
diskpart -p
>Fix:
*** diskpart.c.orig	Thu Mar 15 15:46:06 2001
--- diskpart.c	Thu Mar 15 15:48:12 2001
***************
*** 128,135 ****
  	char *lp, *tyname;
  
  	argc--, argv++;
- 	if (argc < 1)
- 		usage();
  	if (argc > 0 && strcmp(*argv, "-p") == 0) {
  		pflag++;
  		argc--, argv++;
--- 128,133 ----
***************
*** 140,147 ****
  	}
  	if (argc > 1 && strcmp(*argv, "-s") == 0) {
  		totsize = atoi(argv[1]);
! 		argc += 2, argv += 2;
  	}
  	dp = getdiskbyname(*argv);
  	if (dp == NULL) {
  		if (isatty(0))
--- 138,147 ----
  	}
  	if (argc > 1 && strcmp(*argv, "-s") == 0) {
  		totsize = atoi(argv[1]);
! 		argc -= 2, argv += 2;
  	}
+ 	if (argc < 1)
+ 		usage();
  	dp = getdiskbyname(*argv);
  	if (dp == NULL) {
  		if (isatty(0))
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200103150814.f2F8EmH03055>