From owner-svn-src-stable@FreeBSD.ORG Thu Mar 5 09:00:28 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A2FF90A; Thu, 5 Mar 2015 09:00:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25D2F2E4; Thu, 5 Mar 2015 09:00:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2590RFa024626; Thu, 5 Mar 2015 09:00:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2590R8p024625; Thu, 5 Mar 2015 09:00:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201503050900.t2590R8p024625@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 5 Mar 2015 09:00:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r279631 - stable/10/lib/libstdthreads X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2015 09:00:28 -0000 Author: kib Date: Thu Mar 5 09:00:27 2015 New Revision: 279631 URL: https://svnweb.freebsd.org/changeset/base/279631 Log: MFC r279318: Check that the pointer to the thread return value is not NULL before dereferencing. NULL is allowed by C11 and must be handled. Modified: stable/10/lib/libstdthreads/thrd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libstdthreads/thrd.c ============================================================================== --- stable/10/lib/libstdthreads/thrd.c Thu Mar 5 08:53:10 2015 (r279630) +++ stable/10/lib/libstdthreads/thrd.c Thu Mar 5 09:00:27 2015 (r279631) @@ -108,7 +108,8 @@ thrd_join(thrd_t thr, int *res) if (pthread_join(thr, &value_ptr) != 0) return (thrd_error); - *res = (intptr_t)value_ptr; + if (res != NULL) + *res = (intptr_t)value_ptr; return (thrd_success); }