From owner-dev-commits-src-all@freebsd.org Sun Mar 14 09:09:42 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 85A4E5786F9; Sun, 14 Mar 2021 09:09:42 +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 4DytzV2XFyz3FhP; Sun, 14 Mar 2021 09:09:42 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 45C031AC65; Sun, 14 Mar 2021 09:09:42 +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 12E99guG078252; Sun, 14 Mar 2021 09:09:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12E99gcm078251; Sun, 14 Mar 2021 09:09:42 GMT (envelope-from git) Date: Sun, 14 Mar 2021 09:09:42 GMT Message-Id: <202103140909.12E99gcm078251@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ryan Moeller Subject: git: 0fed2239730f - stable/13 - libifconfig: Set error in ifconfig_get_groups MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: freqlabs X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0fed2239730f3bfa7ea71b6468565b8266019526 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Mar 2021 09:09:42 -0000 The branch stable/13 has been updated by freqlabs: URL: https://cgit.FreeBSD.org/src/commit/?id=0fed2239730f3bfa7ea71b6468565b8266019526 commit 0fed2239730f3bfa7ea71b6468565b8266019526 Author: Ryan Moeller AuthorDate: 2021-02-27 08:07:21 +0000 Commit: Ryan Moeller CommitDate: 2021-03-14 08:05:01 +0000 libifconfig: Set error in ifconfig_get_groups This should return -1 with OTHER/ENOMEM set in the handle when malloc fails, like everywhere else in libifconfig. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D28964 (cherry picked from commit 1d9ba697f99a88b321a7d8b96fa142ea774cd3be) --- lib/libifconfig/libifconfig.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/libifconfig/libifconfig.c b/lib/libifconfig/libifconfig.c index e67c4e4de04e..1733239132a0 100644 --- a/lib/libifconfig/libifconfig.c +++ b/lib/libifconfig/libifconfig.c @@ -511,7 +511,9 @@ ifconfig_get_groups(ifconfig_handle_t *h, const char *name, len = ifgr->ifgr_len; ifgr->ifgr_groups = (struct ifg_req *)malloc(len); if (ifgr->ifgr_groups == NULL) { - return (1); + h->error.errtype = OTHER; + h->error.errcode = ENOMEM; + return (-1); } bzero(ifgr->ifgr_groups, len); if (ifconfig_ioctlwrap(h, AF_LOCAL, SIOCGIFGROUP, ifgr) == -1) {