From patchwork Tue Dec 4 15:16:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 1838631 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 782D63FCA5 for ; Tue, 4 Dec 2012 15:16:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752089Ab2LDPQ7 (ORCPT ); Tue, 4 Dec 2012 10:16:59 -0500 Received: from mail-ye0-f174.google.com ([209.85.213.174]:57489 "EHLO mail-ye0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752366Ab2LDPQ6 (ORCPT ); Tue, 4 Dec 2012 10:16:58 -0500 Received: by mail-ye0-f174.google.com with SMTP id m6so609113yen.19 for ; Tue, 04 Dec 2012 07:16:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=8NJiobNWyXpR2uZDHJdg5psvXJzSLg6p/4Yjk1ZMmAk=; b=DldzCV1wihOywDpu4It1qhQWFcePo5QiC35xwsDbF4GeIvw6GwnYQjuOV2X9WIgw44 CpzIkuHYLAPz+YFnIvqwpL+NK8c9F1oGUXBbjWAjvsoR+vzOxq4t57H5bMECsM5J8QQW oz7cMWnETbV2W6Www1BhGNVCjKFJ3t+M9nUNOTgCpWkUGGSe0TuQ110HRrmlney6Im9w mc5mpp4M2p4+DmCh/rfAKfnHrOVQVzc7OeE23S5rHfXPWAFlauPAy4W54tT6idXYMRWk SF4BSvFtcbll3ynbGKRG+hTalxMQN+pwES+CGig3FL9NciRhb2uaOq4zruTm6PL+IXLM lvZA== Received: by 10.100.76.9 with SMTP id y9mr4355019ana.77.1354634217891; Tue, 04 Dec 2012 07:16:57 -0800 (PST) Received: from salusa.poochiereds.net (cpe-107-015-113-143.nc.res.rr.com. [107.15.113.143]) by mx.google.com with ESMTPS id g79sm1219089yhj.6.2012.12.04.07.16.56 (version=SSLv3 cipher=OTHER); Tue, 04 Dec 2012 07:16:57 -0800 (PST) From: Jeff Layton To: linux-cifs@vger.kernel.org Subject: [PATCH 4/6] getcifsacl: use "size" instead of reconverting original field to host endian Date: Tue, 4 Dec 2012 10:16:42 -0500 Message-Id: <1354634204-21602-5-git-send-email-jlayton@samba.org> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1354634204-21602-1-git-send-email-jlayton@samba.org> References: <1354634204-21602-1-git-send-email-jlayton@samba.org> X-Gm-Message-State: ALoCoQkymBbIKKUTZMaNtXa6v/ndRHUkwHJuqkRornjn05ha6jXedLNAtLVhJtTMzAJt3+IQal/V Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Signed-off-by: Jeff Layton --- getcifsacl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/getcifsacl.c b/getcifsacl.c index 626f83c..ac3674c 100644 --- a/getcifsacl.c +++ b/getcifsacl.c @@ -249,11 +249,11 @@ print_ace(struct cifs_ace *pace, char *end_of_acl, int raw) size = le16toh(pace->size); /* 16 == size of cifs_ace when cifs_sid has no subauths */ - if (le16toh(pace->size) < 16) + if (size < 16) return; /* validate that we do not go past end of acl */ - if (end_of_acl < (char *)pace + le16toh(pace->size)) + if (end_of_acl < (char *)pace + size) return; printf("ACL:");