From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Rob Browning Newsgroups: gmane.lisp.guile.devel Subject: [PATCH 0/8] Move py C utility code to pyutil; guard overflow Date: Tue, 30 May 2023 19:49:36 -0500 Message-ID: <20230531004944.1657633-1-rlb@defaultvalue.org> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15611"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Wed May 31 02:50:30 2023 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q4A2o-0003xV-Jz for guile-devel@m.gmane-mx.org; Wed, 31 May 2023 02:50:30 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q4A2C-0006LH-7z; Tue, 30 May 2023 20:49:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4A2A-0006K6-JI for guile-devel@gnu.org; Tue, 30 May 2023 20:49:50 -0400 Original-Received: from defaultvalue.org ([45.33.119.55]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q4A27-0008E7-N7 for guile-devel@gnu.org; Tue, 30 May 2023 20:49:50 -0400 Original-Received: from trouble.defaultvalue.org (localhost [127.0.0.1]) (Authenticated sender: rlb@defaultvalue.org) by defaultvalue.org (Postfix) with ESMTPSA id 6E035202D2 for ; Tue, 30 May 2023 19:49:45 -0500 (CDT) Original-Received: by trouble.defaultvalue.org (Postfix, from userid 1000) id F1A9914E089; Tue, 30 May 2023 19:49:44 -0500 (CDT) X-Mailer: git-send-email 2.39.2 Received-SPF: pass client-ip=45.33.119.55; envelope-from=rlb@defaultvalue.org; helo=defaultvalue.org X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.devel:21842 Archived-At: Proposed for main. This starts moving some of the utility functions to src/bup/pyutil.*, so that we can use them everywhere, e.g. hashsplit, bupsplit... Rob Browning (8): bup_shared_cflags: add -Winline Create src/pyutil.c for utility functions pyutil: add INTEGER_TO_PY as BUP_LONGISH_TO_PY pyutil: add bup_uint_from_py bup_ulong_from_py bup_ullong_from_py pyutil: add BUP_ASSIGN_PYLONG_TO_INTEGRAL; use EXPR_SIGNED _helpers: remove vestigial py2 utimes related code HashSplitter_init: guard against bits/fanbits overflow Reject bup_getpwuid bup_getgrgid argument overflow GNUmakefile | 4 +- lib/bup/_hashsplit.c | 14 +- lib/bup/_helpers.c | 368 +++++-------------------------------------- src/bup/pyutil.c | 93 +++++++++++ src/bup/pyutil.h | 54 +++++++ 5 files changed, 196 insertions(+), 337 deletions(-) create mode 100644 src/bup/pyutil.c create mode 100644 src/bup/pyutil.h -- 2.39.2