From patchwork Sat Jun 15 00:36:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arturo Borrero X-Patchwork-Id: 251564 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 2AADE2C0084 for ; Sat, 15 Jun 2013 10:36:28 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752651Ab3FOAgT (ORCPT ); Fri, 14 Jun 2013 20:36:19 -0400 Received: from smtp3.cica.es ([150.214.5.190]:60748 "EHLO smtp.cica.es" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752497Ab3FOAgT (ORCPT ); Fri, 14 Jun 2013 20:36:19 -0400 Received: from localhost (unknown [127.0.0.1]) by smtp.cica.es (Postfix) with ESMTP id DE8AF51EDA3; Sat, 15 Jun 2013 00:36:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at cica.es Received: from smtp.cica.es ([127.0.0.1]) by localhost (mail.cica.es [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gem-cIi2g-iL; Sat, 15 Jun 2013 02:36:16 +0200 (CEST) Received: from nfdev.cica.es (nfdev.cica.es [IPv6:2a00:9ac0:c1ca:31::220]) by smtp.cica.es (Postfix) with ESMTP id 7FA4451ED7E; Sat, 15 Jun 2013 02:36:14 +0200 (CEST) Subject: [libnftables PATCH] expr: bitwise: xml_parse: fix casting To: netfilter-devel@vger.kernel.org From: Arturo Borrero Cc: pablo@netfilter.org Date: Sat, 15 Jun 2013 02:36:13 +0200 Message-ID: <20130615003613.27171.26876.stgit@nfdev.cica.es> User-Agent: StGit/0.15 MIME-Version: 1.0 Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Not calling e->data when doing the casting causes memory corruption: segfault. This was introduced at: 51370f0eedb1c8167ab2c340d2a53f0d9f02509c (src: add support for XML parsing) Signed-off-by: Arturo Borrero Gonzalez --- src/expr/bitwise.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/src/expr/bitwise.c b/src/expr/bitwise.c index 9ebe3dc..1429483 100644 --- a/src/expr/bitwise.c +++ b/src/expr/bitwise.c @@ -200,7 +200,7 @@ static int nft_rule_expr_bitwise_xml_parse(struct nft_rule_expr *e, char *xml) { #ifdef XML_PARSING - struct nft_expr_bitwise *bitwise = (struct nft_expr_bitwise *)e; + struct nft_expr_bitwise *bitwise = (struct nft_expr_bitwise *)e->data; mxml_node_t *tree = NULL; mxml_node_t *node = NULL; mxml_node_t *save = NULL;