Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2433045yba; Fri, 10 May 2019 11:24:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqwbb7XhO+RS2VwgCwdKT2QmHJJuEn8cFVxXVw1Z/0gWq/HJBW7HLxXjFGE78e1dWeTgyEM6 X-Received: by 2002:a63:ee0a:: with SMTP id e10mr2316295pgi.28.1557512676817; Fri, 10 May 2019 11:24:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557512676; cv=none; d=google.com; s=arc-20160816; b=M0nn+2PYREo47/OpE4X3NSVcqR2nzw/BLrDMsl7eYzKJBXu+Yx1kvrWWkMcupI4CS9 m1AItCnYKrJDMvYWXBSvzGb77eoO5GwnkSFFKIFsPhpzdPf3/q0ZcUo31MmO+/QmG7Fo TWSieF+XKGdzcVAg+5aeK726V8eIdWkT26EYdA9qBGg9C2wIEb1w9TyCrLPNxlfXG2de vDu5LroLYDbBNRZxYxcdKHhj1sBhkfAaXOnjZhchd4TJfkt1MnQH72ittZ5oOX7Ffk30 M1by1HC/VipPmX3NLEqfRHCumWjZZN1ba65CXjXLCQTIT+JncJ5Bzu0bjfpkbpWMCA4T 9P0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=XElxqUkl0T3y6WwzzPJ4evAW9TcTl3+qUjfdOeyhOE8=; b=c3ZuDTsYawswMI9C2QuT3YIxveoo8iLz9lWiXS7xktKTtunJClRj1XBkseYiDlG8Vo yOCLtBAnyeQFbWtJ5AuZvSavnmyNb3ttZiFHjgb39Ii0yDExLq2E4/0hPiHSUpHj+ADB lDQOxV+pLcZf3HTjAaCKaEO0aGxSbW+8g1G3usdCMdV9AxNdoVKhEtEZq2VJVfjeHeyO H8NqFwTlRVVZ87EgeSmEvRExE93+ZC1IwKCBQtRuwn7S1cF+iel3fRGefO906B/VsyVW pvA8M1nZtKTjKo1QDUiy55KZrES6YEdT+T535GwsuzyzvlHOVc17isemmk5qTyfeAf9p 9zqg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w187si7445763pfw.221.2019.05.10.11.24.12; Fri, 10 May 2019 11:24:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727812AbfEJSVJ (ORCPT + 99 others); Fri, 10 May 2019 14:21:09 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:51295 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727453AbfEJSVI (ORCPT ); Fri, 10 May 2019 14:21:08 -0400 Received: from callcc.thunk.org (75-104-86-93.mobility.exede.net [75.104.86.93] (may be forged)) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id x4AIKwio009258 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 May 2019 14:21:05 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id A833E420024; Fri, 10 May 2019 14:20:56 -0400 (EDT) From: "Theodore Ts'o" To: Ext4 Developers List Cc: "Theodore Ts'o" , Gabriel Krisman Bertazi Subject: [PATCH] libext2fs: add missing check for utf8lookup()'s return value Date: Fri, 10 May 2019 14:20:53 -0400 Message-Id: <20190510182053.23819-1-tytso@mit.edu> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Fixes-Coverity-Bug: 1442630 Signed-off-by: Theodore Ts'o Cc: Gabriel Krisman Bertazi --- lib/ext2fs/nls_utf8.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ext2fs/nls_utf8.c b/lib/ext2fs/nls_utf8.c index 42148099a..e4c4e7a30 100644 --- a/lib/ext2fs/nls_utf8.c +++ b/lib/ext2fs/nls_utf8.c @@ -789,6 +789,8 @@ static int utf8byte(struct utf8cursor *u8c) } leaf = utf8lookup(u8c->data, u8c->hangul, u8c->s); + if (!leaf) + return -1; ccc = LEAF_CCC(leaf); } -- 2.19.1