Skip to contentSkip to conversation

expr: bitwise: xml_parse: fix casting

PATCH Applied Arturo Borrero 2 participants 2 messages Jun 15, 2013 – Jun 17, 2013 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 expr: bitwise: xml_parse: fix casting

Not calling e->data when doing the casting causes memory corruption: segfault.

This was introduced at: 51370f0eedb1c8167ab2c340d2a53f0d9f02509c (src: add support for XML parsing)

---
 src/expr/bitwise.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/expr/bitwise.c +1 -1
index 9ebe3dc..1429483 100644
@@ -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;
maintainer Applied
#1 lore raw
Quoted 3 lines · Arturo Borrero

Not calling e->data when doing the casting causes memory corruption: segfault.

This was introduced at: 51370f0eedb1c8167ab2c340d2a53f0d9f02509c (src: add support for XML parsing)

Please, next time use the short commit ID that you can get via git log --oneline.

Applied, thanks.