Received: by mail.netbsd.org (Postfix, from userid 605) id DCE7E84DCF; Wed, 17 Jun 2020 10:52:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 654DC84D82 for ; Wed, 17 Jun 2020 10:52:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id gHfVEvrBO9oo for ; Wed, 17 Jun 2020 10:52:04 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id E975584D80 for ; Wed, 17 Jun 2020 10:52:03 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id E3961FB28; Wed, 17 Jun 2020 10:52:03 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1592391123276640" MIME-Version: 1.0 Date: Wed, 17 Jun 2020 10:52:03 +0000 From: "Nathanial Sloss" Subject: CVS commit: pkgsrc/devel/diffbreaker/files/diffbreaker To: pkgsrc-changes@NetBSD.org Reply-To: nat@netbsd.org X-Mailer: log_accum Message-Id: <20200617105203.E3961FB28@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1592391123276640 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: nat Date: Wed Jun 17 10:52:03 UTC 2020 Modified Files: pkgsrc/devel/diffbreaker/files/diffbreaker: diffbreaker.c Log Message: Fix errors when compiling with __SSP_FORTIFY_LEVEL > 1. Found by wiz@. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 \ pkgsrc/devel/diffbreaker/files/diffbreaker/diffbreaker.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1592391123276640 Content-Disposition: inline Content-Length: 1438 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/devel/diffbreaker/files/diffbreaker/diffbreaker.c diff -u pkgsrc/devel/diffbreaker/files/diffbreaker/diffbreaker.c:1.1 pkgsrc/devel/diffbreaker/files/diffbreaker/diffbreaker.c:1.2 --- pkgsrc/devel/diffbreaker/files/diffbreaker/diffbreaker.c:1.1 Sun May 24 16:44:20 2020 +++ pkgsrc/devel/diffbreaker/files/diffbreaker/diffbreaker.c Wed Jun 17 10:52:03 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: diffbreaker.c,v 1.1 2020/05/24 16:44:20 nat Exp $ */ +/* $NetBSD: diffbreaker.c,v 1.2 2020/06/17 10:52:03 nat Exp $ */ /*- * Copyright (c) 2018, 2019 Nathanial Sloss @@ -138,6 +138,7 @@ mark_dirty(void) display = true; writesect = true; writetome = true; + /* fallthrough */ default: if (j != i) strcpy(ORIGBUF(j), ORIGBUF(i)); @@ -205,7 +206,8 @@ next: if (action[i - l] == 2) break; } - l--; + if (l > 0) + l--; if (tmpcontext) j = update_context(tmpcontext, j, i - l); @@ -410,7 +412,6 @@ read_data_to_buffer(char *myFile) } } l = n--; - cpl--; size_t totalalloc = (size_t)(l * cpl); if (totalalloc <= 0 || l <= 0) @@ -435,6 +436,8 @@ read_data_to_buffer(char *myFile) } memset(newaction, 0, (size_t)l * sizeof(*newaction)); memset(action, 0, (size_t)l * sizeof(*action)); + memset(buffer, 0, (size_t)totalalloc * sizeof(*buffer)); + memset(newbuffer, 0, (size_t)totalalloc * sizeof(*newbuffer)); l = 0; j = n = 0; --_----------=_1592391123276640--