From owner-p4-projects Tue Jul 9 21:42:11 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 57E7737B401; Tue, 9 Jul 2002 21:42:07 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EA99137B400 for ; Tue, 9 Jul 2002 21:42:06 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id AA8DD43E4A for ; Tue, 9 Jul 2002 21:42:06 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from freefall.freebsd.org (perforce@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g6A4g6JU062343 for ; Tue, 9 Jul 2002 21:42:06 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g6A4g6X7062340 for perforce@freebsd.org; Tue, 9 Jul 2002 21:42:06 -0700 (PDT) Date: Tue, 9 Jul 2002 21:42:06 -0700 (PDT) Message-Id: <200207100442.g6A4g6X7062340@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 14011 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://people.freebsd.org/~peter/p4db/chv.cgi?CH=14011 Change 14011 by rwatson@rwatson_paprika on 2002/07/09 21:41:42 If a tree entry doesn't have a type string, don't dereference the string. This prevents the application from segfaulting if you double click a node in the sysctl tree that is not a leaf node. Affected files ... .. //depot/projects/trustedbsd/misc/kmacmanager/sysctllist.cc#4 edit Differences ... ==== //depot/projects/trustedbsd/misc/kmacmanager/sysctllist.cc#4 (text+ko) ==== @@ -212,11 +212,13 @@ void SysctlList::slotDoubleClicked(QListViewItem *item) { + const char *type; char *itemname, buf[BUFSIZ]; int error, newvalue, oldvalue; bool ok = FALSE; - if (strcmp(item->text(3).latin1(), "int") == 0) { + type = item->text(3).latin1(); + if (type != NULL && strcmp(type, "int") == 0) { itemname = strdup(item->text(2).latin1()); oldvalue = atoi(item->text(1).latin1()); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message