浏览代码

net sched actions: avoid bitwise operation on signed value in pedit

Since char can be unsigned or signed, and bitwise operators may have
implementation-dependent results when performed on signed operands,
declare 'u8 *' operand instead.

Suggested-by: Davide Caratti <dcaratti@redhat.com>
Signed-off-by: Roman Mashak <mrv@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Roman Mashak 7 年之前
父节点
当前提交
4305274153
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      net/sched/act_pedit.c

+ 1 - 1
net/sched/act_pedit.c

@@ -311,7 +311,7 @@ static int tcf_pedit(struct sk_buff *skb, const struct tc_action *a,
 			}
 
 			if (tkey->offmask) {
-				char *d, _d;
+				u8 *d, _d;
 
 				if (!offset_valid(skb, hoffset + tkey->at)) {
 					pr_info("tc action pedit 'at' offset %d out of bounds\n",