diff options
Diffstat (limited to 'libiptc/libiptc.c')
-rw-r--r-- | libiptc/libiptc.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libiptc/libiptc.c b/libiptc/libiptc.c index b445331e..670acf53 100644 --- a/libiptc/libiptc.c +++ b/libiptc/libiptc.c @@ -816,14 +816,16 @@ static void iptcc_delete_rule(struct rule_head *r) * to be called from specific places within the parser */ static int __iptcc_p_del_policy(struct xtc_handle *h, unsigned int num) { + const unsigned char *data; + if (h->chain_iterator_cur) { /* policy rule is last rule */ struct rule_head *pr = (struct rule_head *) h->chain_iterator_cur->rules.prev; /* save verdict */ - h->chain_iterator_cur->verdict = - *(int *)GET_TARGET(pr->entry)->data; + data = GET_TARGET(pr->entry)->data; + h->chain_iterator_cur->verdict = *(const int *)data; /* save counter and counter_map information */ h->chain_iterator_cur->counter_map.maptype = @@ -1595,6 +1597,7 @@ const char *TC_GET_TARGET(const STRUCT_ENTRY *ce, { STRUCT_ENTRY *e = (STRUCT_ENTRY *)ce; struct rule_head *r = container_of(e, struct rule_head, entry[0]); + const unsigned char *data; iptc_fn = TC_GET_TARGET; @@ -1608,7 +1611,8 @@ const char *TC_GET_TARGET(const STRUCT_ENTRY *ce, return r->jump->name; break; case IPTCC_R_STANDARD: - spos = *(int *)GET_TARGET(e)->data; + data = GET_TARGET(e)->data; + spos = *(const int *)data; DEBUGP("r=%p, spos=%d'\n", r, spos); return standard_target_map(spos); break; |