expr: bitwise: xml_parse: fix casting
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)
Signed-off-by Arturo Borrero Gonzalez <[email protected]>
--- src/expr/bitwise.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/expr/bitwise.c +1 -1
@@ -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 ;
Quoted 3 lines · Arturo Borrero
Not calling
e->datawhen 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.