From owner-cvs-src@FreeBSD.ORG Fri Mar 26 06:45:35 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C648E16A4CE; Fri, 26 Mar 2004 06:45:35 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A9AA843D41; Fri, 26 Mar 2004 06:45:35 -0800 (PST) (envelope-from mtm@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i2QEjZGe099283; Fri, 26 Mar 2004 06:45:35 -0800 (PST) (envelope-from mtm@repoman.freebsd.org) Received: (from mtm@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i2QEjZH1099282; Fri, 26 Mar 2004 06:45:35 -0800 (PST) (envelope-from mtm) Message-Id: <200403261445.i2QEjZH1099282@repoman.freebsd.org> From: Mike Makonnen Date: Fri, 26 Mar 2004 06:45:35 -0800 (PST) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/lib/libthr/thread thr_find_thread.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2004 14:45:35 -0000 mtm 2004/03/26 06:45:35 PST FreeBSD src repository Modified files: lib/libthr/thread thr_find_thread.c Log: o Initialize a local variable before referencing it. This was not the cause of any bugs because it is *always* indirectly set in the for...loop, but better to be explicit about it. o Check the magic number of the passed in thread only after it has been found in the active thread list. Otherwise, if the check is done at the very beginning we may end up pointing to garbage if the thread was once a valid thread, but has now been destroyed. Revision Changes Path 1.4 +4 -1 src/lib/libthr/thread/thr_find_thread.c