From nobody Sat Sep 24 08:01:28 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MZM0n1bs4z4cl2s; Sat, 24 Sep 2022 08:01:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MZM0n12VMz3dVW; Sat, 24 Sep 2022 08:01:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664006489; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QwvhwFHW9fZWyfPyDqQRgWIOaWYm1kr2DLovcX98BU0=; b=NRQT2uOIaAxYsJhejKv2HgXW/skGe+gXSAl4cBk8iFDiitzDKbziyJznDV7V/MqPH0ufDs XRtahvNWDlMvb/F+RrPt4iAyk0ovuJccTz5T6Z/dv7W4+NE72Oov0+KVX19jf+82R+J3t1 uZ1M3CQ/ZjBj073OLY78sQandcnKS3HrBOkSaKurXT5npE3VHMCD36gHxMo3sn7WED8iBr 5p8RNBVb2z1hLKRzhqemkLinlP/MmqHs6N9BVwnYryLMit3jGG44n/jMqFvqihO9Jvwk9O OSu/4eEc3Enu0yI+w835JaOUGuyM+VEwy4mvwPPVwMtXFglACzWztTKPg0wVyA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MZM0n060Zz11lQ; Sat, 24 Sep 2022 08:01:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 28O81SrF011895; Sat, 24 Sep 2022 08:01:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28O81SZd011894; Sat, 24 Sep 2022 08:01:28 GMT (envelope-from git) Date: Sat, 24 Sep 2022 08:01:28 GMT Message-Id: <202209240801.28O81SZd011894@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 306cfa499a24 - stable/13 - ctime.3: Add a note about a possible return value of localtime(3) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 306cfa499a248567269b303f81a32010470c3369 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664006489; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QwvhwFHW9fZWyfPyDqQRgWIOaWYm1kr2DLovcX98BU0=; b=A6UsfMSr+MJcLq9E6ZrjJn/SbLwfwhThqrcr2Fg5SdRtDiMkhFBjV5EKiVsZ5LKsm8dh3v rHTJB5gJ6lkZNslM3J138qbyQY679JEnRGgPej+jA4oAzt+Hiim+77AorAf6U1+/dsIuMC Y9nnxkwf5jWyubfUUmjKAl6gJiLyzZ9naIxSk5KNYsC7lTc6vV514dU2ZupkeHfZC8DgQl X6imRBcdxTuz4mqg/0R39fQ1L65vDniTfoC/rRksbOp8ACqVcLF2Q6ZGrZJPryorxDgjbc qCGaIbahc0VV2owENr1ScZWF+E4SBEWtHShoR55Wy9u0qAucX52AQdwHqvsVKQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1664006489; a=rsa-sha256; cv=none; b=Vq7h2UhYeUQDM8V5zxJ2WFHZL3RY6W8p/PzdHoTczJxuMIFzbW/0Puqg6TrjV7BDk8055q CAMd+MJNmu07oopV4J2E/9fm2F3UEswaDFZNkF/3cM/sZGBOHxSNg/thedntorN5rTYdqd 6LmkEGNJLON9RY2dRul1LjsJ3zebquvQe6NVPoudXjvsJe1dAXOJE9l8pF/V/wV3ZjFG46 XhLqj3M4anMoPdJF4/rrS9VJyovCl5FQvaN/OzC/ajWJctv+Clq72nHB/aqYN7LN8czk4A SPJvP+wkkk7vBJc2jaDKKbQI0IYOAqYa6LIkah4cfFpCwTDc558Ym+z84yOkmA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=306cfa499a248567269b303f81a32010470c3369 commit 306cfa499a248567269b303f81a32010470c3369 Author: Gordon Bergling AuthorDate: 2022-09-16 18:38:58 +0000 Commit: Gordon Bergling CommitDate: 2022-09-24 08:01:18 +0000 ctime.3: Add a note about a possible return value of localtime(3) The localtime(3) function returns a NULL pointer, if the passed in-time translates to a year that will not fit in an integer type. It is stricly recommended to check the return value to avoid garage output. Reported by: mckusick Reviewed by: mckusick, imp, rpokala Differential Revision: https://reviews.freebsd.org/D36515 (cherry picked from commit 30cfb3c8ee3d3fc79644541207c81d20c72176ce) --- contrib/tzcode/stdtime/ctime.3 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contrib/tzcode/stdtime/ctime.3 b/contrib/tzcode/stdtime/ctime.3 index 771027fa62ec..de3a57bab59e 100644 --- a/contrib/tzcode/stdtime/ctime.3 +++ b/contrib/tzcode/stdtime/ctime.3 @@ -30,7 +30,7 @@ .\" From: @(#)ctime.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd March 4, 2022 +.Dd September 16, 2022 .Dt CTIME 3 .Os .Sh NAME @@ -94,6 +94,10 @@ and returns a pointer to a (described below) which contains the broken-out time information for the value after adjusting for the current time zone (and any other factors such as Daylight Saving Time). +When the specified time translates to a year that will not fit in an +.Dv int , +.Fn localtime +returns NULL. Time zone adjustments are performed as specified by the .Ev TZ environment variable (see