From patchwork Tue Dec 18 13:44:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Schwab X-Patchwork-Id: 1015359 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-98475-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="rzRYfk4n"; 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 43Jzm56xFPz9s3q for ; Wed, 19 Dec 2018 00:44:53 +1100 (AEDT) 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=a98k19C5wGN+tSfqrpejl0wwqpIR9 Qb/g0bkFij+bDiDGrGgD5NxYHOg/ypAxMCISL8rt6dEzSBGQk+t9Op6rHcTVqoXf 3q9EFvMpytx2UKuNFrvW1v1THpYplSWoXWnHbhIxssghcuJ9ntIlQW69aQYwvb/H aTRpQyLEjUMVbU= 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=L1qkDJQD7gwa89EBqIz8yRFpp+4=; b=rzR Yfk4n7FasEr4S3ixsqVOag2pszmUQw/gaCj+nNhOCfDhpAuwbosd7cnjzR4Ly84Z pCqFYbst7IhGdEs/YFKk82MNnlszQ6KyKntmRPRx/qX0dXUjLCi8Bcbiv3aqISzl FKujPDU5QjrbO8b2KZE1LLp6XkAZZx8qxqAjjVGo= Received: (qmail 97649 invoked by alias); 18 Dec 2018 13:44:48 -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 97272 invoked by uid 89); 18 Dec 2018 13:44:48 -0000 Authentication-Results: sourceware.org; auth=none 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=persistent X-HELO: mx1.suse.de From: Andreas Schwab To: libc-alpha@sourceware.org Subject: [PATCH] nscd: avoid assertion failure during persistent db check X-Yow: I'm in ATLANTIC CITY riding in a comfortable ROLLING CHAIR... Date: Tue, 18 Dec 2018 14:44:44 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.90 (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 47fbb9923a..9818200764 100644 --- a/nscd/connections.c +++ b/nscd/connections.c @@ -304,7 +304,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))