From patchwork Tue May 15 13:24:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Schwab X-Patchwork-Id: 27267 Received: (qmail 19633 invoked by alias); 15 May 2018 13:24:39 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 19606 invoked by uid 89); 15 May 2018 13:24:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:872 X-HELO: mx2.suse.de From: Andreas Schwab To: libc-alpha@sourceware.org Subject: [PATCH] nscd: avoid assertion failure during persistent db check X-Yow: The PILLSBURY DOUGHBOY is CRYING for an END to BURT REYNOLDS movies!! Date: Tue, 15 May 2018 15:24:34 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 nscd should not abort when it finds inconsistencies in the persistent db. * nscd/connections.c (check_use): Don't abort on invalid len. --- nscd/connections.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nscd/connections.c b/nscd/connections.c index 5f91985859..d2ac3147a0 100644 --- a/nscd/connections.c +++ b/nscd/connections.c @@ -327,7 +327,8 @@ static int check_use (const char *data, nscd_ssize_t first_free, uint8_t *usemap, enum usekey use, ref_t start, size_t len) { - assert (len >= 2); + if (len < 2) + return 0; if (start > first_free || start + len > first_free || (start & BLOCK_ALIGN_M1))