From nobody Sat Sep 24 08:01:46 2022 X-Original-To: dev-commits-src-branches@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 4MZM162xPVz4clVR; Sat, 24 Sep 2022 08:01:46 +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 4MZM162PS6z3dcW; Sat, 24 Sep 2022 08:01:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664006506; 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=2nJ8dRXtUbOczDBXOTzw+Ff0asvsBG2fQTvra6Exlpc=; b=ud3R+bKHr7Q8WjM+ZVa4Hgy6+HI0WdKT4+fDmBoST5gq2YX7Jaoj/7uILZ63LwW3N3sB3P 7gm51NxF1BlmQdBt+dAx91EwxZ25ETESWrA8jN3JsC1H44KDI0RH5NPBl1kCg1+z0pnRfB 4JhXmUeLnP5shG0JnRiz4K5RGpQ+vUBwbbSkTcl8HgblS+agCmgyn65cXNaP5/Ay5ADW2C DgJODHjkB+f4Pmd5gBgcwHg/wZPRSnaiPOi7OYo9oT8LUrGwSqIn0kEL2qqGz9Uu8tC+Jc hs4mJk9QS2tRWL4S9axjr16dhpO98hob/rHyXWtci+U9EeuhC8JVxSyjMPbgwg== 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 4MZM161MH4z11fh; Sat, 24 Sep 2022 08:01:46 +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 28O81k7T013880; Sat, 24 Sep 2022 08:01:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28O81kxx013879; Sat, 24 Sep 2022 08:01:46 GMT (envelope-from git) Date: Sat, 24 Sep 2022 08:01:46 GMT Message-Id: <202209240801.28O81kxx013879@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: 5c12f9352189 - stable/12 - ctime.3: Add a note about a possible return value of localtime(3) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/12 X-Git-Reftype: branch X-Git-Commit: 5c12f9352189886b11720ddb8774415292cff6fd Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664006506; 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=2nJ8dRXtUbOczDBXOTzw+Ff0asvsBG2fQTvra6Exlpc=; b=Q3DivUzmXHexoyI9hf17V35L7mEqhjQx9UPnOZnrhCiNcFRMZ4mKnx+uIDm4i8zoJhcgxB oA6WFGJiRXIjpd7gqA3TlqiVHU15v81idqFmDGhEu/yOq1Mow4541KuiW9nglPHUbCAp/8 cyt3hqkXtbIzDUDVE70H+v1NV2L9u6GpVq6lp4eJy/folAIwGz0Xn7CN6+ODGGYj5WlNJH A1hKF2J9GBch2rynly5UYuntSfrnKvowgH+yVEc1/vi11XAiERJzCzrMgvLmcxNwTsUK68 nPZrnYuSfaikqPMkua4Au0DltFvlnMIr+6hjl5sz6Znr62s4La1eFkIeYoPL7g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1664006506; a=rsa-sha256; cv=none; b=H7lxcMYfoICB1e+pTM/OA6ZeKF9uvHGVKHCtnaBoxrAoUpT8SAwgYCW2RCTylu7cS8adas 1CGpBaIoOsXcpwJUtsgdxFWnrbPxLyZA59LVY91fLTdx9a0kzYyR8pmQpx56QMeegSt93E 72ToYGuFrji5pQ2agZlaDDSZVg06fuSUxFeCIzVA71K1GHQVKeMxQk0jR8sN5+y73wLZk3 fqwD2lE7+WuvtRKIPbn5WtRVxSxTg2MyV6+5oNOorNllYsSbOnBfVt57+u/HvLa9MzsHGz qzVK2k9KDj0YqdvFpoGhz2RJCdKadqFWw5ns3fRZiNJmW0DvP+tV9gSs7V4+QQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by gbe (doc committer): URL: https://cgit.FreeBSD.org/src/commit/?id=5c12f9352189886b11720ddb8774415292cff6fd commit 5c12f9352189886b11720ddb8774415292cff6fd Author: Gordon Bergling AuthorDate: 2022-09-16 18:38:58 +0000 Commit: Gordon Bergling CommitDate: 2022-09-24 08:01:36 +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 58264bfc7cbb..c1ba6c0f9121 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