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: 913620 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-92522-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="bSKHj6J6"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40ldb167ZTz9s0q for ; Tue, 15 May 2018 23:24:45 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type; q=dns; s=default; b=mOjXMmCd+CjTGtyEvbPBR/kOe/irI EYJ2bntWT22EQbte8hiphpfUvX8JFo9oJmxFt7J6K/JX9HXXPDejxVf3dPo1xWlw J+yoSOgd9UNsxpnZ9NNpVAEu8hw8sapLLA4c4y3pLy1wOqgq7d/xiU/qYq4dwaES gNULnN+Pm1yFts= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type; s=default; bh=g2ZV0B4ycrOqKXjP+qkNhNrFNlY=; b=bSK Hj6J6rXKJzUEaJgCbLZP6VXKNVyTiE4fH+xjdByq4mpANkqY+TAErW58b1HhbiO5 e7/xN9KHYiSCm4YHKHp1YuWyS9+OZFpJM4+VhV0cz6qcbFKXIo0QnQ597n48BIcS D6ykxA1vcYQBQffQH3MMWtFZb/NLgP96vSPr3j6s= 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))