From nobody Thu Feb 3 02:49:33 2022 X-Original-To: dev-commits-src-main@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 415C519A0F16; Thu, 3 Feb 2022 02:49:34 +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 4Jq36P5JHJz4b3q; Thu, 3 Feb 2022 02:49:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643856573; 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=gEvhuB3wxoh+08Z0CsOTu33AydDZ/1EzLlUAX6Yegf8=; b=H7XnMPcot1CBcdwyVR9xyoAupu+UuJ+SPAHV8qQu+5oW9Ke1GnGtB4Gc5dM/gg4NZAt2Se kzOOdermYucvk+dwvWOIgA0bHUlMUMdXVzskAro/9KWO7oNMf/vwJIOr/+FXUBXwwetWAi wYzHsHLC7HMlSLfdIYACXWmJfXZQw8iZIbOZAbTGi0nGIZblU9ZoH/gpG67D4tSbJ4w/f/ sITRcs/bPF3MvoXOvJo4bQkEezpVDDrJVvF0h7gaASVIhhKfTOQtKly+15sjOLz3wIc+s2 VAEmoEUNUCaCn9IFc4qzhTYCc9jTKRwplqya9mdp2snWAtxCu1XtGjofpISW1Q== 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 8911F100FF; Thu, 3 Feb 2022 02:49:33 +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 2132nXTa087111; Thu, 3 Feb 2022 02:49:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2132nXRF087110; Thu, 3 Feb 2022 02:49:33 GMT (envelope-from git) Date: Thu, 3 Feb 2022 02:49:33 GMT Message-Id: <202202030249.2132nXRF087110@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: bc9ce839f981 - main - __messages_load(): check for calloc() failure List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bc9ce839f9811ee9e3990bb26c00031a84fa50bd Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643856573; 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=gEvhuB3wxoh+08Z0CsOTu33AydDZ/1EzLlUAX6Yegf8=; b=aTO8Ztn9L/dOWYe0LXaerRzLCMec0QjVJ1oQB51ON6eKk9YJQEzN3vM0fMvhzzXPhIARUy QMlBXVFiV/fm1ttjwjJikcbhizrGbhJq0knIXrBvxA1N1fvckMaNid6wb8tq1eZxt937T2 GvPUflztuFaBfYJTESeHMrTycacCErUyxqY+ukStPonZdFJ7sZPJzvYfe1F+RKV7Zg33gY lJ5pQQpVtpjTNaWcVshoYMSIUrgk6YDIp8sPXeMODvT1vrLhMquhId/ghzHg2lL5qFn6ho 5Tn2W4Rgk74FB+MlaEXaZLFdDu+Qx63Gbgjbf6YIWf0iAcXdv74MkGhs1nI6fw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643856573; a=rsa-sha256; cv=none; b=Bc2XhcfIm96m2TtK1pPQC6VnZTaPgiM49Ha7d1r3JFeMq3rqbBfXUi8GrzVi8TyYQgkZ6e 9KLgouoVaJDgdxx0vLb5l72yHFGY97ec5D8PGQNnUr5ge4wZ3gT3L5eRzDY3wdVEUx+/4Y 9uB/f6L9CLbwI7T9OhpxSdj8+gvhI0jqKlAeWbURkPEpHkY1q9LVoLIzjapV3Iwx/A7GpR /f0GBfwpLWxWJ5pAwdxzzQyu5ItNs4iPCE/uU1QJ1bG7tad+9luzjoEtenWao+yYAi6ukt DFxA6Rak0fJTG2QpYUJRBhrl4cB/+q3pX07vLjavPk/x5ayW/2RhY4CZBxMNKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bc9ce839f9811ee9e3990bb26c00031a84fa50bd commit bc9ce839f9811ee9e3990bb26c00031a84fa50bd Author: Konstantin Belousov AuthorDate: 2022-02-02 18:07:42 +0000 Commit: Konstantin Belousov CommitDate: 2022-02-03 01:03:24 +0000 __messages_load(): check for calloc() failure Noted and reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D34140 --- lib/libc/locale/lmessages.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libc/locale/lmessages.c b/lib/libc/locale/lmessages.c index fd00fc16a4ea..70de30650346 100644 --- a/lib/libc/locale/lmessages.c +++ b/lib/libc/locale/lmessages.c @@ -101,6 +101,8 @@ __messages_load(const char *name, locale_t l) { struct xlocale_messages *new = calloc(sizeof(struct xlocale_messages), 1); + if (new == NULL) + return (NULL); new->header.header.destructor = destruct_messages; if (messages_load_locale(new, &l->using_messages_locale, name) == _LDP_ERROR) {