|
@@ -2293,9 +2293,12 @@ static int compat_do_replace(struct net *net, void __user *user,
|
|
|
|
|
|
|
|
xt_compat_lock(NFPROTO_BRIDGE);
|
|
xt_compat_lock(NFPROTO_BRIDGE);
|
|
|
|
|
|
|
|
- ret = xt_compat_init_offsets(NFPROTO_BRIDGE, tmp.nentries);
|
|
|
|
|
- if (ret < 0)
|
|
|
|
|
- goto out_unlock;
|
|
|
|
|
|
|
+ if (tmp.nentries) {
|
|
|
|
|
+ ret = xt_compat_init_offsets(NFPROTO_BRIDGE, tmp.nentries);
|
|
|
|
|
+ if (ret < 0)
|
|
|
|
|
+ goto out_unlock;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
ret = compat_copy_entries(entries_tmp, tmp.entries_size, &state);
|
|
ret = compat_copy_entries(entries_tmp, tmp.entries_size, &state);
|
|
|
if (ret < 0)
|
|
if (ret < 0)
|
|
|
goto out_unlock;
|
|
goto out_unlock;
|